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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/i18n/icu_util.h" | 14 #include "base/i18n/icu_util.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/metrics/statistics_recorder.h" |
19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
20 #include "base/process/launch.h" | 21 #include "base/process/launch.h" |
21 #include "base/process/memory.h" | 22 #include "base/process/memory.h" |
22 #include "base/process/process_handle.h" | 23 #include "base/process/process_handle.h" |
23 #include "base/profiler/alternate_timer.h" | 24 #include "base/profiler/alternate_timer.h" |
24 #include "base/profiler/scoped_tracker.h" | 25 #include "base/profiler/scoped_tracker.h" |
25 #include "base/strings/string_number_conversions.h" | 26 #include "base/strings/string_number_conversions.h" |
26 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
27 #include "base/strings/stringprintf.h" | 28 #include "base/strings/stringprintf.h" |
28 #include "base/trace_event/trace_event.h" | 29 #include "base/trace_event/trace_event.h" |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 auto icudata_region = g_fds->GetRegion(kAndroidICUDataDescriptor); | 698 auto icudata_region = g_fds->GetRegion(kAndroidICUDataDescriptor); |
698 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd, | 699 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd, |
699 icudata_region)); | 700 icudata_region)); |
700 } else { | 701 } else { |
701 CHECK(base::i18n::InitializeICU()); | 702 CHECK(base::i18n::InitializeICU()); |
702 } | 703 } |
703 #else | 704 #else |
704 CHECK(base::i18n::InitializeICU()); | 705 CHECK(base::i18n::InitializeICU()); |
705 #endif // OS_ANDROID | 706 #endif // OS_ANDROID |
706 | 707 |
| 708 base::StatisticsRecorder::Initialize(); |
| 709 |
707 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 710 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
708 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 711 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
709 #if !defined(OS_ANDROID) | 712 #if !defined(OS_ANDROID) |
710 // kV8NativesDataDescriptor and kV8SnapshotDataDescriptor could be shared | 713 // kV8NativesDataDescriptor and kV8SnapshotDataDescriptor could be shared |
711 // with child processes via file descriptors. On Android they are set in | 714 // with child processes via file descriptors. On Android they are set in |
712 // ChildProcessService::InternalInitChildProcess, otherwise set them here. | 715 // ChildProcessService::InternalInitChildProcess, otherwise set them here. |
713 if (command_line.HasSwitch(switches::kV8NativesPassedByFD)) { | 716 if (command_line.HasSwitch(switches::kV8NativesPassedByFD)) { |
714 g_fds->Set( | 717 g_fds->Set( |
715 kV8NativesDataDescriptor, | 718 kV8NativesDataDescriptor, |
716 kV8NativesDataDescriptor + base::GlobalDescriptors::kBaseDescriptor); | 719 kV8NativesDataDescriptor + base::GlobalDescriptors::kBaseDescriptor); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 | 845 |
843 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 846 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
844 }; | 847 }; |
845 | 848 |
846 // static | 849 // static |
847 ContentMainRunner* ContentMainRunner::Create() { | 850 ContentMainRunner* ContentMainRunner::Create() { |
848 return new ContentMainRunnerImpl(); | 851 return new ContentMainRunnerImpl(); |
849 } | 852 } |
850 | 853 |
851 } // namespace content | 854 } // namespace content |
OLD | NEW |