Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: content/renderer/renderer_main.cc

Issue 10779040: Initialize StatisticsRecorder in Child Process to hold (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/child_process.cc ('k') | net/base/run_all_unittests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
16 #include "base/metrics/stats_counters.h" 15 #include "base/metrics/stats_counters.h"
17 #include "base/path_service.h" 16 #include "base/path_service.h"
18 #include "base/process_util.h" 17 #include "base/process_util.h"
19 #include "base/string_util.h" 18 #include "base/string_util.h"
20 #include "base/system_monitor/system_monitor.h" 19 #include "base/system_monitor/system_monitor.h"
21 #include "base/threading/platform_thread.h" 20 #include "base/threading/platform_thread.h"
22 #include "base/time.h" 21 #include "base/time.h"
23 #include "content/common/pepper_plugin_registry.h" 22 #include "content/common/pepper_plugin_registry.h"
24 #include "content/public/common/content_switches.h" 23 #include "content/public/common/content_switches.h"
25 #include "content/public/common/main_function_params.h" 24 #include "content/public/common/main_function_params.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 base::PlatformThread::SetName("CrRendererMain"); 206 base::PlatformThread::SetName("CrRendererMain");
208 207
209 base::SystemMonitor system_monitor; 208 base::SystemMonitor system_monitor;
210 HighResolutionTimerManager hi_res_timer_manager; 209 HighResolutionTimerManager hi_res_timer_manager;
211 210
212 platform.PlatformInitialize(); 211 platform.PlatformInitialize();
213 212
214 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); 213 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
215 platform.InitSandboxTests(no_sandbox); 214 platform.InitSandboxTests(no_sandbox);
216 215
217 // Initialize histogram statistics gathering system.
218 // Don't create StatisticsRecorder in the single process mode.
219 scoped_ptr<base::StatisticsRecorder> statistics;
220 if (!base::StatisticsRecorder::IsActive()) {
221 statistics.reset(new base::StatisticsRecorder());
222 }
223
224 // Initialize statistical testing infrastructure. We set client_id to the 216 // Initialize statistical testing infrastructure. We set client_id to the
225 // empty string to disallow the renderer process from creating its own 217 // empty string to disallow the renderer process from creating its own
226 // one-time randomized trials; they should be created in the browser process. 218 // one-time randomized trials; they should be created in the browser process.
227 base::FieldTrialList field_trial(EmptyString()); 219 base::FieldTrialList field_trial(EmptyString());
228 // Ensure any field trials in browser are reflected into renderer. 220 // Ensure any field trials in browser are reflected into renderer.
229 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { 221 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) {
230 std::string persistent = parsed_command_line.GetSwitchValueASCII( 222 std::string persistent = parsed_command_line.GetSwitchValueASCII(
231 switches::kForceFieldTrials); 223 switches::kForceFieldTrials);
232 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); 224 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent);
233 DCHECK(ret); 225 DCHECK(ret);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 #endif 261 #endif
270 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 262 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
271 MessageLoop::current()->Run(); 263 MessageLoop::current()->Run();
272 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 264 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
273 } 265 }
274 } 266 }
275 platform.PlatformUninitialize(); 267 platform.PlatformUninitialize();
276 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 268 TRACE_EVENT_END_ETW("RendererMain", 0, "");
277 return 0; 269 return 0;
278 } 270 }
OLDNEW
« no previous file with comments | « content/common/child_process.cc ('k') | net/base/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698