Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index e07ea7aa1525c34b4ffab0b1a833072daa79498a..20c1c340eb17a96ad9aa5341ffa5c2b6c605bd7e 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -174,6 +174,7 @@ |
#endif |
#if defined(OS_ANDROID) |
+#include "base/android/apk_assets.h" |
#include "ui/base/ui_base_paths.h" |
#include "ui/gfx/android/device_display_info.h" |
#endif |
@@ -2223,7 +2224,12 @@ void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( |
void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
const base::CommandLine& command_line, |
int child_process_id, |
- FileDescriptorInfo* mappings) { |
+ FileDescriptorInfo* mappings |
+#if defined(OS_ANDROID) |
+ , |
+ std::map<int, base::MemoryMappedFile::Region>* regions |
+#endif |
+ ) { |
#if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) { |
int v8_natives_fd = -1; |
@@ -2279,17 +2285,14 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
} |
} |
- base::FilePath app_data_path; |
- PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path); |
- DCHECK(!app_data_path.empty()); |
- |
- flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
- base::FilePath icudata_path = |
- app_data_path.AppendASCII(base::i18n::kIcuDataFileName); |
- base::File icudata_file(icudata_path, flags); |
- DCHECK(icudata_file.IsValid()); |
- mappings->Transfer(kAndroidICUDataDescriptor, |
- base::ScopedFD(icudata_file.TakePlatformFile())); |
+ if (!icudtl_fd_.is_valid()) { |
+ icudtl_fd_.reset(base::android::OpenApkAsset(base::i18n::kIcuDataFileName, |
+ &icudtl_region_)); |
+ DCHECK(icudtl_fd_.is_valid()); |
+ } |
+ mappings->Share(kAndroidICUDataDescriptor, icudtl_fd_.get()); |
+ regions->insert(std::make_pair(kAndroidICUDataDescriptor, icudtl_region_)); |
jam
2015/06/04 03:13:30
why is chrome layer doing this instead of content
agrieve
2015/06/04 19:17:20
I'm new to this code, and have no idea. I do know
jam
2015/06/09 01:12:46
Hi, please work with someone on the android side t
Yaron
2015/06/09 03:39:40
Hmm. I definitely touched the crash fd code and it
|
+ |
#else |
int crash_signal_fd = GetCrashSignalFD(command_line); |
if (crash_signal_fd >= 0) { |