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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/metrics/statistics_recorder.h" | 16 #include "base/metrics/statistics_recorder.h" |
17 #include "base/metrics/stats_counters.h" | 17 #include "base/metrics/stats_counters.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/pending_task.h" | 19 #include "base/pending_task.h" |
| 20 #include "base/power_monitor/power_monitor.h" |
20 #include "base/process_util.h" | 21 #include "base/process_util.h" |
21 #include "base/string_util.h" | 22 #include "base/string_util.h" |
22 #include "base/system_monitor/system_monitor.h" | |
23 #include "base/threading/platform_thread.h" | 23 #include "base/threading/platform_thread.h" |
24 #include "base/time.h" | 24 #include "base/time.h" |
25 #include "content/common/pepper_plugin_registry.h" | 25 #include "content/common/pepper_plugin_registry.h" |
26 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
27 #include "content/public/common/main_function_params.h" | 27 #include "content/public/common/main_function_params.h" |
28 #include "content/public/renderer/content_renderer_client.h" | 28 #include "content/public/renderer/content_renderer_client.h" |
29 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 29 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
30 #include "content/renderer/render_process_impl.h" | 30 #include "content/renderer/render_process_impl.h" |
31 #include "content/renderer/render_thread_impl.h" | 31 #include "content/renderer/render_thread_impl.h" |
32 #include "content/renderer/renderer_main_platform_delegate.h" | 32 #include "content/renderer/renderer_main_platform_delegate.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 main_message_loop.AddTaskObserver(&task_observer); | 154 main_message_loop.AddTaskObserver(&task_observer); |
155 | 155 |
156 scoped_ptr<MemoryObserver> memory_observer; | 156 scoped_ptr<MemoryObserver> memory_observer; |
157 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { | 157 if (parsed_command_line.HasSwitch(switches::kMemoryMetrics)) { |
158 memory_observer.reset(new MemoryObserver()); | 158 memory_observer.reset(new MemoryObserver()); |
159 main_message_loop.AddTaskObserver(memory_observer.get()); | 159 main_message_loop.AddTaskObserver(memory_observer.get()); |
160 } | 160 } |
161 | 161 |
162 base::PlatformThread::SetName("CrRendererMain"); | 162 base::PlatformThread::SetName("CrRendererMain"); |
163 | 163 |
164 base::SystemMonitor system_monitor; | 164 base::PowerMonitor power_monitor; |
165 HighResolutionTimerManager hi_res_timer_manager; | 165 HighResolutionTimerManager hi_res_timer_manager; |
166 | 166 |
167 platform.PlatformInitialize(); | 167 platform.PlatformInitialize(); |
168 | 168 |
169 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 169 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
170 platform.InitSandboxTests(no_sandbox); | 170 platform.InitSandboxTests(no_sandbox); |
171 | 171 |
172 // Initialize histogram statistics gathering system. | 172 // Initialize histogram statistics gathering system. |
173 base::StatisticsRecorder::Initialize(); | 173 base::StatisticsRecorder::Initialize(); |
174 | 174 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 MessageLoop::current()->Run(); | 226 MessageLoop::current()->Run(); |
227 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 227 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
228 } | 228 } |
229 } | 229 } |
230 platform.PlatformUninitialize(); | 230 platform.PlatformUninitialize(); |
231 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 231 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
232 return 0; | 232 return 0; |
233 } | 233 } |
234 | 234 |
235 } // namespace content | 235 } // namespace content |
OLD | NEW |