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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 FileDescriptorInfo* mappings, | 2283 FileDescriptorInfo* mappings, |
2284 std::map<int, base::MemoryMappedFile::Region>* regions) { | 2284 std::map<int, base::MemoryMappedFile::Region>* regions) { |
2285 int fd = ui::GetMainAndroidPackFd( | 2285 int fd = ui::GetMainAndroidPackFd( |
2286 &(*regions)[kAndroidUIResourcesPakDescriptor]); | 2286 &(*regions)[kAndroidUIResourcesPakDescriptor]); |
2287 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); | 2287 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); |
2288 | 2288 |
2289 fd = ui::GetCommonResourcesPackFd( | 2289 fd = ui::GetCommonResourcesPackFd( |
2290 &(*regions)[kAndroidChrome100PercentPakDescriptor]); | 2290 &(*regions)[kAndroidChrome100PercentPakDescriptor]); |
2291 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); | 2291 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); |
2292 | 2292 |
2293 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | 2293 fd = ui::GetLocalePackFd(&(*regions)[kAndroidLocalePakDescriptor]); |
2294 const std::string locale = GetApplicationLocale(); | 2294 mappings->Share(kAndroidLocalePakDescriptor, fd); |
2295 base::FilePath locale_pak = ResourceBundle::GetSharedInstance(). | |
2296 GetLocaleFilePath(locale, false); | |
2297 base::File file(locale_pak, flags); | |
2298 DCHECK(file.IsValid()); | |
2299 mappings->Transfer(kAndroidLocalePakDescriptor, | |
2300 base::ScopedFD(file.TakePlatformFile())); | |
2301 | 2295 |
2302 if (breakpad::IsCrashReporterEnabled()) { | 2296 if (breakpad::IsCrashReporterEnabled()) { |
2303 file = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | 2297 base::File file = |
2304 child_process_id); | 2298 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( |
| 2299 child_process_id); |
2305 if (file.IsValid()) { | 2300 if (file.IsValid()) { |
2306 mappings->Transfer(kAndroidMinidumpDescriptor, | 2301 mappings->Transfer(kAndroidMinidumpDescriptor, |
2307 base::ScopedFD(file.TakePlatformFile())); | 2302 base::ScopedFD(file.TakePlatformFile())); |
2308 } else { | 2303 } else { |
2309 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | 2304 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " |
2310 "be disabled for this process."; | 2305 "be disabled for this process."; |
2311 } | 2306 } |
2312 } | 2307 } |
2313 | 2308 |
2314 base::FilePath app_data_path; | 2309 base::FilePath app_data_path; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 switches::kDisableWebRtcEncryption, | 2538 switches::kDisableWebRtcEncryption, |
2544 }; | 2539 }; |
2545 to_command_line->CopySwitchesFrom(from_command_line, | 2540 to_command_line->CopySwitchesFrom(from_command_line, |
2546 kWebRtcDevSwitchNames, | 2541 kWebRtcDevSwitchNames, |
2547 arraysize(kWebRtcDevSwitchNames)); | 2542 arraysize(kWebRtcDevSwitchNames)); |
2548 } | 2543 } |
2549 } | 2544 } |
2550 #endif // defined(ENABLE_WEBRTC) | 2545 #endif // defined(ENABLE_WEBRTC) |
2551 | 2546 |
2552 } // namespace chrome | 2547 } // namespace chrome |
OLD | NEW |