OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 // this value could be passed in a different way. | 716 // this value could be passed in a different way. |
717 const std::string locale = | 717 const std::string locale = |
718 command_line.GetSwitchValueASCII(switches::kLang); | 718 command_line.GetSwitchValueASCII(switches::kLang); |
719 #if defined(OS_ANDROID) | 719 #if defined(OS_ANDROID) |
720 // The renderer sandbox prevents us from accessing our .pak files directly. | 720 // The renderer sandbox prevents us from accessing our .pak files directly. |
721 // Therefore file descriptors to the .pak files that we need are passed in | 721 // Therefore file descriptors to the .pak files that we need are passed in |
722 // at process creation time. | 722 // at process creation time. |
723 int locale_pak_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( | 723 int locale_pak_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( |
724 kAndroidLocalePakDescriptor); | 724 kAndroidLocalePakDescriptor); |
725 CHECK(locale_pak_fd != -1); | 725 CHECK(locale_pak_fd != -1); |
726 ResourceBundle::InitSharedInstanceWithPakFile(base::File(locale_pak_fd), | 726 ResourceBundle::InitSharedInstanceWithPakFileRegion( |
727 false); | 727 base::File(locale_pak_fd), |
| 728 base::MemoryMappedFile::Region::kWholeFile, |
| 729 false); |
728 | 730 |
729 int extra_pak_keys[] = { | 731 int extra_pak_keys[] = { |
730 kAndroidChrome100PercentPakDescriptor, | 732 kAndroidChrome100PercentPakDescriptor, |
731 kAndroidUIResourcesPakDescriptor, | 733 kAndroidUIResourcesPakDescriptor, |
732 }; | 734 }; |
733 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) { | 735 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) { |
734 int pak_fd = | 736 int pak_fd = |
735 base::GlobalDescriptors::GetInstance()->MaybeGet(extra_pak_keys[i]); | 737 base::GlobalDescriptors::GetInstance()->MaybeGet(extra_pak_keys[i]); |
736 CHECK(pak_fd != -1); | 738 CHECK(pak_fd != -1); |
737 ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 739 ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 } | 921 } |
920 | 922 |
921 content::ContentUtilityClient* | 923 content::ContentUtilityClient* |
922 ChromeMainDelegate::CreateContentUtilityClient() { | 924 ChromeMainDelegate::CreateContentUtilityClient() { |
923 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 925 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
924 return NULL; | 926 return NULL; |
925 #else | 927 #else |
926 return g_chrome_content_utility_client.Pointer(); | 928 return g_chrome_content_utility_client.Pointer(); |
927 #endif | 929 #endif |
928 } | 930 } |
OLD | NEW |