Chromium Code Reviews| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) && defined(OS_MACOSX) | |
| 15 #include "base/mac/bundle_locations.h" | |
| 16 #endif | |
|
rmcilroy
2014/09/23 10:04:20
I don't think you need this here?
baixo
2014/09/23 11:36:46
Done.
| |
| 14 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 15 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 16 #include "base/prefs/scoped_user_pref_update.h" | 19 #include "base/prefs/scoped_user_pref_update.h" |
| 17 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/threading/sequenced_worker_pool.h" | 22 #include "base/threading/sequenced_worker_pool.h" |
| 20 #include "chrome/browser/browser_about_handler.h" | 23 #include "chrome/browser/browser_about_handler.h" |
| 21 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/browser_shutdown.h" | 25 #include "chrome/browser/browser_shutdown.h" |
| 23 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 26 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| (...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2442 DCHECK(!app_data_path.empty()); | 2445 DCHECK(!app_data_path.empty()); |
| 2443 | 2446 |
| 2444 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | 2447 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| 2445 base::FilePath icudata_path = | 2448 base::FilePath icudata_path = |
| 2446 app_data_path.AppendASCII("icudtl.dat"); | 2449 app_data_path.AppendASCII("icudtl.dat"); |
| 2447 base::File icudata_file(icudata_path, flags); | 2450 base::File icudata_file(icudata_path, flags); |
| 2448 DCHECK(icudata_file.IsValid()); | 2451 DCHECK(icudata_file.IsValid()); |
| 2449 mappings->push_back(FileDescriptorInfo(kAndroidICUDataDescriptor, | 2452 mappings->push_back(FileDescriptorInfo(kAndroidICUDataDescriptor, |
| 2450 FileDescriptor(icudata_file.Pass()))); | 2453 FileDescriptor(icudata_file.Pass()))); |
| 2451 | 2454 |
| 2455 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | |
| 2456 base::FilePath v8_data_path; | |
| 2457 PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path); | |
| 2458 DCHECK(!v8_data_path.empty()); | |
| 2459 | |
| 2460 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | |
| 2461 base::FilePath v8_natives_data_path = | |
| 2462 v8_data_path.AppendASCII("natives_blob.bin"); | |
| 2463 base::FilePath v8_snapshot_data_path = | |
| 2464 v8_data_path.AppendASCII("snapshot_blob.bin"); | |
| 2465 base::File v8_natives_data_file(v8_natives_data_path, file_flags); | |
| 2466 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags); | |
| 2467 DCHECK(v8_natives_data_file.IsValid()); | |
| 2468 DCHECK(v8_snapshot_data_file.IsValid()); | |
| 2469 mappings->push_back(FileDescriptorInfo(kV8NativesDataDescriptor, | |
| 2470 FileDescriptor(v8_natives_data_file.Pass()))); | |
| 2471 mappings->push_back(FileDescriptorInfo(kV8SnapshotDataDescriptor, | |
| 2472 FileDescriptor(v8_snapshot_data_file.Pass()))); | |
| 2473 #endif // V8_USE_EXTERNAL_STARTUP_DATA | |
| 2474 | |
| 2452 #else | 2475 #else |
| 2453 int crash_signal_fd = GetCrashSignalFD(command_line); | 2476 int crash_signal_fd = GetCrashSignalFD(command_line); |
| 2454 if (crash_signal_fd >= 0) { | 2477 if (crash_signal_fd >= 0) { |
| 2455 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, | 2478 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, |
| 2456 FileDescriptor(crash_signal_fd, | 2479 FileDescriptor(crash_signal_fd, |
| 2457 false))); | 2480 false))); |
| 2458 } | 2481 } |
| 2459 #endif // defined(OS_ANDROID) | 2482 #endif // defined(OS_ANDROID) |
| 2460 } | 2483 } |
| 2461 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 2484 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2593 switches::kDisableWebRtcEncryption, | 2616 switches::kDisableWebRtcEncryption, |
| 2594 }; | 2617 }; |
| 2595 to_command_line->CopySwitchesFrom(from_command_line, | 2618 to_command_line->CopySwitchesFrom(from_command_line, |
| 2596 kWebRtcDevSwitchNames, | 2619 kWebRtcDevSwitchNames, |
| 2597 arraysize(kWebRtcDevSwitchNames)); | 2620 arraysize(kWebRtcDevSwitchNames)); |
| 2598 } | 2621 } |
| 2599 } | 2622 } |
| 2600 #endif // defined(ENABLE_WEBRTC) | 2623 #endif // defined(ENABLE_WEBRTC) |
| 2601 | 2624 |
| 2602 } // namespace chrome | 2625 } // namespace chrome |
| OLD | NEW |