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

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

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years, 7 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 | « chrome/renderer/prerender/prerender_helper.cc ('k') | net/base/host_resolver_impl.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(OS_MACOSX) 5 #if defined(OS_MACOSX)
6 #include <signal.h> 6 #include <signal.h>
7 #include <unistd.h> 7 #include <unistd.h>
8 #endif // OS_MACOSX 8 #endif // OS_MACOSX
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); 184 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
185 platform.InitSandboxTests(no_sandbox); 185 platform.InitSandboxTests(no_sandbox);
186 186
187 // Initialize histogram statistics gathering system. 187 // Initialize histogram statistics gathering system.
188 // Don't create StatisticsRecorder in the single process mode. 188 // Don't create StatisticsRecorder in the single process mode.
189 scoped_ptr<base::StatisticsRecorder> statistics; 189 scoped_ptr<base::StatisticsRecorder> statistics;
190 if (!base::StatisticsRecorder::IsActive()) { 190 if (!base::StatisticsRecorder::IsActive()) {
191 statistics.reset(new base::StatisticsRecorder()); 191 statistics.reset(new base::StatisticsRecorder());
192 } 192 }
193 193
194 // Initialize statistical testing infrastructure. 194 // Initialize statistical testing infrastructure. We set client_id to the
195 base::FieldTrialList field_trial; 195 // empty string to disallow the renderer process from creating its own
196 // one-time randomized trials; they should be created in the browser process.
197 base::FieldTrialList field_trial(EmptyString());
196 // Ensure any field trials in browser are reflected into renderer. 198 // Ensure any field trials in browser are reflected into renderer.
197 if (parsed_command_line.HasSwitch(switches::kForceFieldTestNameAndValue)) { 199 if (parsed_command_line.HasSwitch(switches::kForceFieldTestNameAndValue)) {
198 std::string persistent = parsed_command_line.GetSwitchValueASCII( 200 std::string persistent = parsed_command_line.GetSwitchValueASCII(
199 switches::kForceFieldTestNameAndValue); 201 switches::kForceFieldTestNameAndValue);
200 bool ret = field_trial.CreateTrialsInChildProcess(persistent); 202 bool ret = field_trial.CreateTrialsInChildProcess(persistent);
201 DCHECK(ret); 203 DCHECK(ret);
202 } 204 }
203 205
204 // Load pepper plugins before engaging the sandbox. 206 // Load pepper plugins before engaging the sandbox.
205 PepperPluginRegistry::GetInstance(); 207 PepperPluginRegistry::GetInstance();
(...skipping 25 matching lines...) Expand all
231 pool->Recycle(); 233 pool->Recycle();
232 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
233 MessageLoop::current()->Run(); 235 MessageLoop::current()->Run();
234 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
235 } 237 }
236 } 238 }
237 platform.PlatformUninitialize(); 239 platform.PlatformUninitialize();
238 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 240 TRACE_EVENT_END_ETW("RendererMain", 0, "");
239 return 0; 241 return 0;
240 } 242 }
OLDNEW
« no previous file with comments | « chrome/renderer/prerender/prerender_helper.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698