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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/allocator/allocator_check.h" | 13 #include "base/allocator/allocator_check.h" |
14 #include "base/allocator/allocator_extension.h" | 14 #include "base/allocator/allocator_extension.h" |
15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/debug/debugger.h" | 17 #include "base/debug/debugger.h" |
18 #include "base/debug/stack_trace.h" | 18 #include "base/debug/stack_trace.h" |
19 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
20 #include "base/i18n/icu_util.h" | 20 #include "base/i18n/icu_util.h" |
21 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
22 #include "base/logging.h" | 22 #include "base/logging.h" |
23 #include "base/macros.h" | 23 #include "base/macros.h" |
24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
25 #include "base/memory/scoped_vector.h" | 25 #include "base/memory/scoped_vector.h" |
| 26 #include "base/metrics/histogram_base.h" |
26 #include "base/metrics/statistics_recorder.h" | 27 #include "base/metrics/statistics_recorder.h" |
27 #include "base/path_service.h" | 28 #include "base/path_service.h" |
28 #include "base/process/launch.h" | 29 #include "base/process/launch.h" |
29 #include "base/process/memory.h" | 30 #include "base/process/memory.h" |
30 #include "base/process/process_handle.h" | 31 #include "base/process/process_handle.h" |
31 #include "base/profiler/scoped_tracker.h" | 32 #include "base/profiler/scoped_tracker.h" |
32 #include "base/strings/string_number_conversions.h" | 33 #include "base/strings/string_number_conversions.h" |
33 #include "base/strings/string_util.h" | 34 #include "base/strings/string_util.h" |
34 #include "base/strings/stringprintf.h" | 35 #include "base/strings/stringprintf.h" |
35 #include "base/trace_event/trace_event.h" | 36 #include "base/trace_event/trace_event.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 } | 751 } |
751 | 752 |
752 int Run() override { | 753 int Run() override { |
753 DCHECK(is_initialized_); | 754 DCHECK(is_initialized_); |
754 DCHECK(!is_shutdown_); | 755 DCHECK(!is_shutdown_); |
755 const base::CommandLine& command_line = | 756 const base::CommandLine& command_line = |
756 *base::CommandLine::ForCurrentProcess(); | 757 *base::CommandLine::ForCurrentProcess(); |
757 std::string process_type = | 758 std::string process_type = |
758 command_line.GetSwitchValueASCII(switches::kProcessType); | 759 command_line.GetSwitchValueASCII(switches::kProcessType); |
759 | 760 |
| 761 base::HistogramBase::EnableActivityReportHistogram(process_type); |
| 762 |
760 MainFunctionParams main_params(command_line); | 763 MainFunctionParams main_params(command_line); |
761 main_params.ui_task = ui_task_; | 764 main_params.ui_task = ui_task_; |
762 #if defined(OS_WIN) | 765 #if defined(OS_WIN) |
763 main_params.sandbox_info = &sandbox_info_; | 766 main_params.sandbox_info = &sandbox_info_; |
764 #elif defined(OS_MACOSX) | 767 #elif defined(OS_MACOSX) |
765 main_params.autorelease_pool = autorelease_pool_.get(); | 768 main_params.autorelease_pool = autorelease_pool_.get(); |
766 #endif | 769 #endif |
767 | 770 |
768 #if !defined(OS_IOS) | 771 #if !defined(OS_IOS) |
769 return RunNamedProcessTypeMain(process_type, main_params, delegate_); | 772 return RunNamedProcessTypeMain(process_type, main_params, delegate_); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 831 |
829 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 832 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
830 }; | 833 }; |
831 | 834 |
832 // static | 835 // static |
833 ContentMainRunner* ContentMainRunner::Create() { | 836 ContentMainRunner* ContentMainRunner::Create() { |
834 return new ContentMainRunnerImpl(); | 837 return new ContentMainRunnerImpl(); |
835 } | 838 } |
836 | 839 |
837 } // namespace content | 840 } // namespace content |
OLD | NEW |