Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1262)

Unified Diff: chromecast/browser/cast_content_browser_client.cc

Issue 977443002: Chromecast Android: pass ICU file descriptor to render process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: int --> const int Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_content_browser_client.cc
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc
index 2ccdcd3dcb581bea43d2b4ba437319793857fcb4..589fdc82996029a8bb20f9afd0a4f268970529f7 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,10 +274,10 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
int child_process_id,
content::FileDescriptorInfo* mappings) {
#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;
CHECK(PathService::Get(FILE_CAST_PAK, &pak_file));
- base::File pak_with_flags(pak_file, flags);
+ base::File pak_with_flags(pak_file, flags_open_read);
if (!pak_with_flags.IsValid()) {
NOTREACHED() << "Failed to open file when creating renderer process: "
<< "cast_shell.pak";
@@ -297,6 +298,15 @@ 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);
+ DCHECK(icudata_file.IsValid());
+ mappings->Transfer(kAndroidICUDataDescriptor,
+ base::ScopedFD(icudata_file.TakePlatformFile()));
#else
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698