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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 746 } |
746 | 747 |
747 int Run() override { | 748 int Run() override { |
748 DCHECK(is_initialized_); | 749 DCHECK(is_initialized_); |
749 DCHECK(!is_shutdown_); | 750 DCHECK(!is_shutdown_); |
750 const base::CommandLine& command_line = | 751 const base::CommandLine& command_line = |
751 *base::CommandLine::ForCurrentProcess(); | 752 *base::CommandLine::ForCurrentProcess(); |
752 std::string process_type = | 753 std::string process_type = |
753 command_line.GetSwitchValueASCII(switches::kProcessType); | 754 command_line.GetSwitchValueASCII(switches::kProcessType); |
754 | 755 |
| 756 base::HistogramBase::EnableActivityReportHistogram(process_type); |
| 757 |
755 MainFunctionParams main_params(command_line); | 758 MainFunctionParams main_params(command_line); |
756 main_params.ui_task = ui_task_; | 759 main_params.ui_task = ui_task_; |
757 #if defined(OS_WIN) | 760 #if defined(OS_WIN) |
758 main_params.sandbox_info = &sandbox_info_; | 761 main_params.sandbox_info = &sandbox_info_; |
759 #elif defined(OS_MACOSX) | 762 #elif defined(OS_MACOSX) |
760 main_params.autorelease_pool = autorelease_pool_.get(); | 763 main_params.autorelease_pool = autorelease_pool_.get(); |
761 #endif | 764 #endif |
762 | 765 |
763 #if !defined(OS_IOS) | 766 #if !defined(OS_IOS) |
764 return RunNamedProcessTypeMain(process_type, main_params, delegate_); | 767 return RunNamedProcessTypeMain(process_type, main_params, delegate_); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 | 826 |
824 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 827 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
825 }; | 828 }; |
826 | 829 |
827 // static | 830 // static |
828 ContentMainRunner* ContentMainRunner::Create() { | 831 ContentMainRunner* ContentMainRunner::Create() { |
829 return new ContentMainRunnerImpl(); | 832 return new ContentMainRunnerImpl(); |
830 } | 833 } |
831 | 834 |
832 } // namespace content | 835 } // namespace content |
OLD | NEW |