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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 #include "chrome/browser/chrome_browser_main_posix.h" | 166 #include "chrome/browser/chrome_browser_main_posix.h" |
167 #endif | 167 #endif |
168 | 168 |
169 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 169 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
170 #include "base/debug/leak_annotations.h" | 170 #include "base/debug/leak_annotations.h" |
171 #include "components/crash/app/breakpad_linux.h" | 171 #include "components/crash/app/breakpad_linux.h" |
172 #include "components/crash/browser/crash_handler_host_linux.h" | 172 #include "components/crash/browser/crash_handler_host_linux.h" |
173 #endif | 173 #endif |
174 | 174 |
175 #if defined(OS_ANDROID) | 175 #if defined(OS_ANDROID) |
| 176 #include "base/android/apk_assets.h" |
176 #include "ui/base/ui_base_paths.h" | 177 #include "ui/base/ui_base_paths.h" |
177 #include "ui/gfx/android/device_display_info.h" | 178 #include "ui/gfx/android/device_display_info.h" |
178 #endif | 179 #endif |
179 | 180 |
180 #if defined(TOOLKIT_VIEWS) | 181 #if defined(TOOLKIT_VIEWS) |
181 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | 182 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
182 #endif | 183 #endif |
183 | 184 |
184 #if defined(USE_ASH) | 185 #if defined(USE_ASH) |
185 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" | 186 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" |
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 child_process_id); | 2273 child_process_id); |
2273 if (file.IsValid()) { | 2274 if (file.IsValid()) { |
2274 mappings->Transfer(kAndroidMinidumpDescriptor, | 2275 mappings->Transfer(kAndroidMinidumpDescriptor, |
2275 base::ScopedFD(file.TakePlatformFile())); | 2276 base::ScopedFD(file.TakePlatformFile())); |
2276 } else { | 2277 } else { |
2277 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | 2278 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " |
2278 "be disabled for this process."; | 2279 "be disabled for this process."; |
2279 } | 2280 } |
2280 } | 2281 } |
2281 | 2282 |
2282 base::FilePath app_data_path; | 2283 if (!icudtl_fd_.is_valid()) { |
2283 PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path); | 2284 icudtl_fd_.reset(base::android::OpenApkAsset(base::i18n::kIcuDataFileName, |
2284 DCHECK(!app_data_path.empty()); | 2285 &icudtl_region_)); |
| 2286 DCHECK(icudtl_fd_.is_valid()); |
| 2287 } |
| 2288 mappings->Share(kAndroidICUDataDescriptor, icudtl_fd_.get()); |
| 2289 regions->insert(std::make_pair(kAndroidICUDataDescriptor, icudtl_region_)); |
2285 | 2290 |
2286 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | |
2287 base::FilePath icudata_path = | |
2288 app_data_path.AppendASCII(base::i18n::kIcuDataFileName); | |
2289 base::File icudata_file(icudata_path, flags); | |
2290 DCHECK(icudata_file.IsValid()); | |
2291 mappings->Transfer(kAndroidICUDataDescriptor, | |
2292 base::ScopedFD(icudata_file.TakePlatformFile())); | |
2293 #else | 2291 #else |
2294 int crash_signal_fd = GetCrashSignalFD(command_line); | 2292 int crash_signal_fd = GetCrashSignalFD(command_line); |
2295 if (crash_signal_fd >= 0) { | 2293 if (crash_signal_fd >= 0) { |
2296 mappings->Share(kCrashDumpSignal, crash_signal_fd); | 2294 mappings->Share(kCrashDumpSignal, crash_signal_fd); |
2297 } | 2295 } |
2298 #endif // defined(OS_ANDROID) | 2296 #endif // defined(OS_ANDROID) |
2299 } | 2297 } |
2300 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 2298 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
2301 | 2299 |
2302 #if defined(OS_WIN) | 2300 #if defined(OS_WIN) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2446 switches::kDisableWebRtcEncryption, | 2444 switches::kDisableWebRtcEncryption, |
2447 }; | 2445 }; |
2448 to_command_line->CopySwitchesFrom(from_command_line, | 2446 to_command_line->CopySwitchesFrom(from_command_line, |
2449 kWebRtcDevSwitchNames, | 2447 kWebRtcDevSwitchNames, |
2450 arraysize(kWebRtcDevSwitchNames)); | 2448 arraysize(kWebRtcDevSwitchNames)); |
2451 } | 2449 } |
2452 } | 2450 } |
2453 #endif // defined(ENABLE_WEBRTC) | 2451 #endif // defined(ENABLE_WEBRTC) |
2454 | 2452 |
2455 } // namespace chrome | 2453 } // namespace chrome |
OLD | NEW |