Commit 568f4362 authored by gunsch's avatar gunsch Committed by Commit bot

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}
parent 7ee951aa
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/i18n/icu_util.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "chromecast/browser/cast_browser_context.h" #include "chromecast/browser/cast_browser_context.h"
...@@ -273,17 +274,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( ...@@ -273,17 +274,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
int child_process_id, int child_process_id,
content::FileDescriptorInfo* mappings) { content::FileDescriptorInfo* mappings) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; const int flags_open_read = base::File::FLAG_OPEN | base::File::FLAG_READ;
base::FilePath pak_file; base::FilePath pak_file_path;
CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); CHECK(PathService::Get(FILE_CAST_PAK, &pak_file_path));
base::File pak_with_flags(pak_file, flags); base::File pak_file(pak_file_path, flags_open_read);
if (!pak_with_flags.IsValid()) { if (!pak_file.IsValid()) {
NOTREACHED() << "Failed to open file when creating renderer process: " NOTREACHED() << "Failed to open file when creating renderer process: "
<< "cast_shell.pak"; << "cast_shell.pak";
} }
mappings->Transfer( mappings->Transfer(kAndroidPakDescriptor,
kAndroidPakDescriptor, base::ScopedFD(pak_file.TakePlatformFile()));
base::ScopedFD(pak_with_flags.TakePlatformFile()));
if (breakpad::IsCrashReporterEnabled()) { if (breakpad::IsCrashReporterEnabled()) {
base::File minidump_file( base::File minidump_file(
...@@ -297,6 +297,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( ...@@ -297,6 +297,16 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
base::ScopedFD(minidump_file.TakePlatformFile())); 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 #else
int crash_signal_fd = GetCrashSignalFD(command_line); int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) { if (crash_signal_fd >= 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment