| 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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 #include "components/user_manager/user_manager.h" | 156 #include "components/user_manager/user_manager.h" |
| 157 #elif defined(OS_LINUX) | 157 #elif defined(OS_LINUX) |
| 158 #include "chrome/browser/chrome_browser_main_linux.h" | 158 #include "chrome/browser/chrome_browser_main_linux.h" |
| 159 #elif defined(OS_ANDROID) | 159 #elif defined(OS_ANDROID) |
| 160 #include "chrome/browser/android/new_tab_page_url_handler.h" | 160 #include "chrome/browser/android/new_tab_page_url_handler.h" |
| 161 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 161 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 162 #include "chrome/browser/chrome_browser_main_android.h" | 162 #include "chrome/browser/chrome_browser_main_android.h" |
| 163 #include "chrome/common/descriptors_android.h" | 163 #include "chrome/common/descriptors_android.h" |
| 164 #include "components/crash/browser/crash_dump_manager_android.h" | 164 #include "components/crash/browser/crash_dump_manager_android.h" |
| 165 #include "components/service_tab_launcher/browser/android/service_tab_launcher.h
" | 165 #include "components/service_tab_launcher/browser/android/service_tab_launcher.h
" |
| 166 #include "ui/base/resource/resource_bundle_android.h" |
| 166 #elif defined(OS_POSIX) | 167 #elif defined(OS_POSIX) |
| 167 #include "chrome/browser/chrome_browser_main_posix.h" | 168 #include "chrome/browser/chrome_browser_main_posix.h" |
| 168 #endif | 169 #endif |
| 169 | 170 |
| 170 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 171 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 171 #include "base/debug/leak_annotations.h" | 172 #include "base/debug/leak_annotations.h" |
| 172 #include "components/crash/app/breakpad_linux.h" | 173 #include "components/crash/app/breakpad_linux.h" |
| 173 #include "components/crash/browser/crash_handler_host_linux.h" | 174 #include "components/crash/browser/crash_handler_host_linux.h" |
| 174 #endif | 175 #endif |
| 175 | 176 |
| (...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 for (size_t i = 0; i < extra_parts_.size(); ++i) { | 2207 for (size_t i = 0; i < extra_parts_.size(); ++i) { |
| 2207 extra_parts_[i]->GetAdditionalFileSystemBackends( | 2208 extra_parts_[i]->GetAdditionalFileSystemBackends( |
| 2208 browser_context, storage_partition_path, additional_backends); | 2209 browser_context, storage_partition_path, additional_backends); |
| 2209 } | 2210 } |
| 2210 } | 2211 } |
| 2211 | 2212 |
| 2212 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 2213 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 2213 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 2214 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 2214 const base::CommandLine& command_line, | 2215 const base::CommandLine& command_line, |
| 2215 int child_process_id, | 2216 int child_process_id, |
| 2216 FileDescriptorInfo* mappings) { | 2217 FileDescriptorInfo* mappings |
| 2217 #if defined(OS_ANDROID) | 2218 #if defined(OS_ANDROID) |
| 2218 base::FilePath data_path; | 2219 , std::map<int, base::MemoryMappedFile::Region>* regions |
| 2219 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 2220 #endif |
| 2220 DCHECK(!data_path.empty()); | 2221 ) { |
| 2222 #if defined(OS_ANDROID) |
| 2223 int fd = ui::GetMainAndroidPackFd( |
| 2224 &(*regions)[kAndroidUIResourcesPakDescriptor]); |
| 2225 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); |
| 2226 |
| 2227 fd = ui::GetCommonResourcesPackFd( |
| 2228 &(*regions)[kAndroidChrome100PercentPakDescriptor]); |
| 2229 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); |
| 2221 | 2230 |
| 2222 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | 2231 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| 2223 base::FilePath chrome_resources_pak = | |
| 2224 data_path.AppendASCII("chrome_100_percent.pak"); | |
| 2225 base::File file(chrome_resources_pak, flags); | |
| 2226 DCHECK(file.IsValid()); | |
| 2227 mappings->Transfer(kAndroidChrome100PercentPakDescriptor, | |
| 2228 base::ScopedFD(file.TakePlatformFile())); | |
| 2229 | |
| 2230 const std::string locale = GetApplicationLocale(); | 2232 const std::string locale = GetApplicationLocale(); |
| 2231 base::FilePath locale_pak = ResourceBundle::GetSharedInstance(). | 2233 base::FilePath locale_pak = ResourceBundle::GetSharedInstance(). |
| 2232 GetLocaleFilePath(locale, false); | 2234 GetLocaleFilePath(locale, false); |
| 2233 file.Initialize(locale_pak, flags); | 2235 base::File file(locale_pak, flags); |
| 2234 DCHECK(file.IsValid()); | 2236 DCHECK(file.IsValid()); |
| 2235 mappings->Transfer(kAndroidLocalePakDescriptor, | 2237 mappings->Transfer(kAndroidLocalePakDescriptor, |
| 2236 base::ScopedFD(file.TakePlatformFile())); | 2238 base::ScopedFD(file.TakePlatformFile())); |
| 2237 | 2239 |
| 2238 base::FilePath resources_pack_path; | |
| 2239 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | |
| 2240 file.Initialize(resources_pack_path, flags); | |
| 2241 DCHECK(file.IsValid()); | |
| 2242 mappings->Transfer(kAndroidUIResourcesPakDescriptor, | |
| 2243 base::ScopedFD(file.TakePlatformFile())); | |
| 2244 | |
| 2245 if (breakpad::IsCrashReporterEnabled()) { | 2240 if (breakpad::IsCrashReporterEnabled()) { |
| 2246 file = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | 2241 file = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( |
| 2247 child_process_id); | 2242 child_process_id); |
| 2248 if (file.IsValid()) { | 2243 if (file.IsValid()) { |
| 2249 mappings->Transfer(kAndroidMinidumpDescriptor, | 2244 mappings->Transfer(kAndroidMinidumpDescriptor, |
| 2250 base::ScopedFD(file.TakePlatformFile())); | 2245 base::ScopedFD(file.TakePlatformFile())); |
| 2251 } else { | 2246 } else { |
| 2252 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | 2247 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " |
| 2253 "be disabled for this process."; | 2248 "be disabled for this process."; |
| 2254 } | 2249 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2434 switches::kDisableWebRtcEncryption, | 2429 switches::kDisableWebRtcEncryption, |
| 2435 }; | 2430 }; |
| 2436 to_command_line->CopySwitchesFrom(from_command_line, | 2431 to_command_line->CopySwitchesFrom(from_command_line, |
| 2437 kWebRtcDevSwitchNames, | 2432 kWebRtcDevSwitchNames, |
| 2438 arraysize(kWebRtcDevSwitchNames)); | 2433 arraysize(kWebRtcDevSwitchNames)); |
| 2439 } | 2434 } |
| 2440 } | 2435 } |
| 2441 #endif // defined(ENABLE_WEBRTC) | 2436 #endif // defined(ENABLE_WEBRTC) |
| 2442 | 2437 |
| 2443 } // namespace chrome | 2438 } // namespace chrome |
| OLD | NEW |