| 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 ca4790073fa03a83ac5fbc5f932ae5338f45324a..bd28909da46c6645e5dbf673756e618a4261e1ef 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -163,6 +163,7 @@
|
| #include "chrome/common/descriptors_android.h"
|
| #include "components/crash/browser/crash_dump_manager_android.h"
|
| #include "components/service_tab_launcher/browser/android/service_tab_launcher.h"
|
| +#include "ui/base/resource/resource_bundle_android.h"
|
| #elif defined(OS_POSIX)
|
| #include "chrome/browser/chrome_browser_main_posix.h"
|
| #endif
|
| @@ -2213,35 +2214,29 @@ void ChromeContentBrowserClient::GetAdditionalFileSystemBackends(
|
| void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
|
| const base::CommandLine& command_line,
|
| int child_process_id,
|
| - FileDescriptorInfo* mappings) {
|
| + FileDescriptorInfo* mappings
|
| #if defined(OS_ANDROID)
|
| - base::FilePath data_path;
|
| - PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path);
|
| - DCHECK(!data_path.empty());
|
| + , std::map<int, base::MemoryMappedFile::Region>* regions
|
| +#endif
|
| + ) {
|
| +#if defined(OS_ANDROID)
|
| + int fd = ui::GetMainAndroidPackFd(
|
| + &(*regions)[kAndroidUIResourcesPakDescriptor]);
|
| + mappings->Share(kAndroidUIResourcesPakDescriptor, fd);
|
|
|
| - int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
|
| - base::FilePath chrome_resources_pak =
|
| - data_path.AppendASCII("chrome_100_percent.pak");
|
| - base::File file(chrome_resources_pak, flags);
|
| - DCHECK(file.IsValid());
|
| - mappings->Transfer(kAndroidChrome100PercentPakDescriptor,
|
| - base::ScopedFD(file.TakePlatformFile()));
|
| + fd = ui::GetCommonResourcesPackFd(
|
| + &(*regions)[kAndroidChrome100PercentPakDescriptor]);
|
| + mappings->Share(kAndroidChrome100PercentPakDescriptor, fd);
|
|
|
| + int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
|
| const std::string locale = GetApplicationLocale();
|
| base::FilePath locale_pak = ResourceBundle::GetSharedInstance().
|
| GetLocaleFilePath(locale, false);
|
| - file.Initialize(locale_pak, flags);
|
| + base::File file(locale_pak, flags);
|
| DCHECK(file.IsValid());
|
| mappings->Transfer(kAndroidLocalePakDescriptor,
|
| base::ScopedFD(file.TakePlatformFile()));
|
|
|
| - base::FilePath resources_pack_path;
|
| - PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
|
| - file.Initialize(resources_pack_path, flags);
|
| - DCHECK(file.IsValid());
|
| - mappings->Transfer(kAndroidUIResourcesPakDescriptor,
|
| - base::ScopedFD(file.TakePlatformFile()));
|
| -
|
| if (breakpad::IsCrashReporterEnabled()) {
|
| file = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
|
| child_process_id);
|
|
|