diff options
author | gunsch <gunsch@chromium.org> | 2015-03-04 09:23:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-04 17:24:25 +0000 |
commit | 568f43629db2ee7c2121adf576c21e06554d5c2e (patch) | |
tree | 70f1d745fcda33a77f95a8b74d8660c17dddf0e2 /chromecast | |
parent | 7ee951aad36bcd3d9cb5c1ef5ce504822a53073e (diff) | |
download | chromium_src-568f43629db2ee7c2121adf576c21e06554d5c2e.zip chromium_src-568f43629db2ee7c2121adf576c21e06554d5c2e.tar.gz chromium_src-568f43629db2ee7c2121adf576c21e06554d5c2e.tar.bz2 |
Chromecast Android: pass ICU file descriptor to render process.
R=lcwu@chromium.org,halliwell@chromium.org
BUG=internal b/19559717
Review URL: https://codereview.chromium.org/977443002
Cr-Commit-Position: refs/heads/master@{#319079}
Diffstat (limited to 'chromecast')
-rw-r--r-- | chromecast/browser/cast_content_browser_client.cc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 2ccdcd3..56a8250 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc @@ -9,6 +9,7 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/files/scoped_file.h" +#include "base/i18n/icu_util.h" #include "base/i18n/rtl.h" #include "base/path_service.h" #include "chromecast/browser/cast_browser_context.h" @@ -273,17 +274,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( int child_process_id, content::FileDescriptorInfo* mappings) { #if defined(OS_ANDROID) - int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; - base::FilePath pak_file; - CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); - base::File pak_with_flags(pak_file, flags); - if (!pak_with_flags.IsValid()) { + const int flags_open_read = base::File::FLAG_OPEN | base::File::FLAG_READ; + base::FilePath pak_file_path; + CHECK(PathService::Get(FILE_CAST_PAK, &pak_file_path)); + base::File pak_file(pak_file_path, flags_open_read); + if (!pak_file.IsValid()) { NOTREACHED() << "Failed to open file when creating renderer process: " << "cast_shell.pak"; } - mappings->Transfer( - kAndroidPakDescriptor, - base::ScopedFD(pak_with_flags.TakePlatformFile())); + mappings->Transfer(kAndroidPakDescriptor, + base::ScopedFD(pak_file.TakePlatformFile())); if (breakpad::IsCrashReporterEnabled()) { base::File minidump_file( @@ -297,6 +297,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( base::ScopedFD(minidump_file.TakePlatformFile())); } } + + base::FilePath app_data_path; + CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path)); + base::FilePath icudata_path = + app_data_path.AppendASCII(base::i18n::kIcuDataFileName); + base::File icudata_file(icudata_path, flags_open_read); + if (!icudata_file.IsValid()) + NOTREACHED() << "Failed to open ICU file when creating renderer process"; + mappings->Transfer(kAndroidICUDataDescriptor, + base::ScopedFD(icudata_file.TakePlatformFile())); #else int crash_signal_fd = GetCrashSignalFD(command_line); if (crash_signal_fd >= 0) { |