| 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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2220 FileDescriptorInfo* mappings, | 2220 FileDescriptorInfo* mappings, |
| 2221 std::map<int, base::MemoryMappedFile::Region>* regions) { | 2221 std::map<int, base::MemoryMappedFile::Region>* regions) { |
| 2222 int fd = ui::GetMainAndroidPackFd( | 2222 int fd = ui::GetMainAndroidPackFd( |
| 2223 &(*regions)[kAndroidUIResourcesPakDescriptor]); | 2223 &(*regions)[kAndroidUIResourcesPakDescriptor]); |
| 2224 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); | 2224 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); |
| 2225 | 2225 |
| 2226 fd = ui::GetCommonResourcesPackFd( | 2226 fd = ui::GetCommonResourcesPackFd( |
| 2227 &(*regions)[kAndroidChrome100PercentPakDescriptor]); | 2227 &(*regions)[kAndroidChrome100PercentPakDescriptor]); |
| 2228 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); | 2228 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); |
| 2229 | 2229 |
| 2230 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | 2230 fd = ui::GetLocalePackFd(&(*regions)[kAndroidLocalePakDescriptor]); |
| 2231 const std::string locale = GetApplicationLocale(); | 2231 mappings->Share(kAndroidLocalePakDescriptor, fd); |
| 2232 base::FilePath locale_pak = ResourceBundle::GetSharedInstance(). | |
| 2233 GetLocaleFilePath(locale, false); | |
| 2234 base::File file(locale_pak, flags); | |
| 2235 DCHECK(file.IsValid()); | |
| 2236 mappings->Transfer(kAndroidLocalePakDescriptor, | |
| 2237 base::ScopedFD(file.TakePlatformFile())); | |
| 2238 | 2232 |
| 2239 if (breakpad::IsCrashReporterEnabled()) { | 2233 if (breakpad::IsCrashReporterEnabled()) { |
| 2240 file = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | 2234 base::File file = |
| 2241 child_process_id); | 2235 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( |
| 2236 child_process_id); |
| 2242 if (file.IsValid()) { | 2237 if (file.IsValid()) { |
| 2243 mappings->Transfer(kAndroidMinidumpDescriptor, | 2238 mappings->Transfer(kAndroidMinidumpDescriptor, |
| 2244 base::ScopedFD(file.TakePlatformFile())); | 2239 base::ScopedFD(file.TakePlatformFile())); |
| 2245 } else { | 2240 } else { |
| 2246 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | 2241 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " |
| 2247 "be disabled for this process."; | 2242 "be disabled for this process."; |
| 2248 } | 2243 } |
| 2249 } | 2244 } |
| 2250 | 2245 |
| 2251 base::FilePath app_data_path; | 2246 base::FilePath app_data_path; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 switches::kDisableWebRtcEncryption, | 2427 switches::kDisableWebRtcEncryption, |
| 2433 }; | 2428 }; |
| 2434 to_command_line->CopySwitchesFrom(from_command_line, | 2429 to_command_line->CopySwitchesFrom(from_command_line, |
| 2435 kWebRtcDevSwitchNames, | 2430 kWebRtcDevSwitchNames, |
| 2436 arraysize(kWebRtcDevSwitchNames)); | 2431 arraysize(kWebRtcDevSwitchNames)); |
| 2437 } | 2432 } |
| 2438 } | 2433 } |
| 2439 #endif // defined(ENABLE_WEBRTC) | 2434 #endif // defined(ENABLE_WEBRTC) |
| 2440 | 2435 |
| 2441 } // namespace chrome | 2436 } // namespace chrome |
| OLD | NEW |