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/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/hi_res_timer_manager.h" | 9 #include "base/hi_res_timer_manager.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/metrics/statistics_recorder.h" |
15 #include "base/metrics/stats_counters.h" | 16 #include "base/metrics/stats_counters.h" |
16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
17 #include "base/process_util.h" | 18 #include "base/process_util.h" |
18 #include "base/string_util.h" | 19 #include "base/string_util.h" |
19 #include "base/system_monitor/system_monitor.h" | 20 #include "base/system_monitor/system_monitor.h" |
20 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
21 #include "base/time.h" | 22 #include "base/time.h" |
22 #include "content/common/pepper_plugin_registry.h" | 23 #include "content/common/pepper_plugin_registry.h" |
23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
24 #include "content/public/common/main_function_params.h" | 25 #include "content/public/common/main_function_params.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 base::PlatformThread::SetName("CrRendererMain"); | 168 base::PlatformThread::SetName("CrRendererMain"); |
168 | 169 |
169 base::SystemMonitor system_monitor; | 170 base::SystemMonitor system_monitor; |
170 HighResolutionTimerManager hi_res_timer_manager; | 171 HighResolutionTimerManager hi_res_timer_manager; |
171 | 172 |
172 platform.PlatformInitialize(); | 173 platform.PlatformInitialize(); |
173 | 174 |
174 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 175 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
175 platform.InitSandboxTests(no_sandbox); | 176 platform.InitSandboxTests(no_sandbox); |
176 | 177 |
| 178 // Initialize histogram statistics gathering system. |
| 179 base::StatisticsRecorder::Initialize(); |
| 180 |
177 // Initialize statistical testing infrastructure. We set client_id to the | 181 // Initialize statistical testing infrastructure. We set client_id to the |
178 // empty string to disallow the renderer process from creating its own | 182 // empty string to disallow the renderer process from creating its own |
179 // one-time randomized trials; they should be created in the browser process. | 183 // one-time randomized trials; they should be created in the browser process. |
180 base::FieldTrialList field_trial(EmptyString()); | 184 base::FieldTrialList field_trial(EmptyString()); |
181 // Ensure any field trials in browser are reflected into renderer. | 185 // Ensure any field trials in browser are reflected into renderer. |
182 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { | 186 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { |
183 std::string persistent = parsed_command_line.GetSwitchValueASCII( | 187 std::string persistent = parsed_command_line.GetSwitchValueASCII( |
184 switches::kForceFieldTrials); | 188 switches::kForceFieldTrials); |
185 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); | 189 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); |
186 DCHECK(ret); | 190 DCHECK(ret); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 #endif | 222 #endif |
219 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 223 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
220 MessageLoop::current()->Run(); | 224 MessageLoop::current()->Run(); |
221 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 225 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
222 } | 226 } |
223 } | 227 } |
224 platform.PlatformUninitialize(); | 228 platform.PlatformUninitialize(); |
225 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 229 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
226 return 0; | 230 return 0; |
227 } | 231 } |
OLD | NEW |