| 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 117a7d435a5e0a3d82caaf81721844e3e148ff5e..9b81a2c6b0296417d9dc26c20e4ca2902813966e 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
|
| @@ -2219,7 +2220,11 @@ 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;
|
| @@ -2275,17 +2280,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_));
|
| +
|
| #else
|
| int crash_signal_fd = GetCrashSignalFD(command_line);
|
| if (crash_signal_fd >= 0) {
|
|
|