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

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

Issue 17945002: Make --force-fieldtrials not activate them in the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
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/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/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 base::StatisticsRecorder::Initialize(); 176 base::StatisticsRecorder::Initialize();
177 177
178 // Initialize statistical testing infrastructure. We set the entropy provider 178 // Initialize statistical testing infrastructure. We set the entropy provider
179 // to NULL to disallow the renderer process from creating its own one-time 179 // to NULL to disallow the renderer process from creating its own one-time
180 // randomized trials; they should be created in the browser process. 180 // randomized trials; they should be created in the browser process.
181 base::FieldTrialList field_trial_list(NULL); 181 base::FieldTrialList field_trial_list(NULL);
182 // Ensure any field trials in browser are reflected into renderer. 182 // Ensure any field trials in browser are reflected into renderer.
183 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { 183 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) {
184 std::string persistent = parsed_command_line.GetSwitchValueASCII( 184 std::string persistent = parsed_command_line.GetSwitchValueASCII(
185 switches::kForceFieldTrials); 185 switches::kForceFieldTrials);
186 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); 186 // Field trials are created in an "activated" state to ensure they get
187 DCHECK(ret); 187 // reported in crash reports.
188 const bool result = base::FieldTrialList::CreateTrialsFromString(
189 parsed_command_line.GetSwitchValueASCII(switches::kForceFieldTrials),
190 base::FieldTrialList::ACTIVATE_TRIALS);
191 DCHECK(result);
188 } 192 }
189 193
190 #if defined(ENABLE_PLUGINS) 194 #if defined(ENABLE_PLUGINS)
191 // Load pepper plugins before engaging the sandbox. 195 // Load pepper plugins before engaging the sandbox.
192 PepperPluginRegistry::GetInstance(); 196 PepperPluginRegistry::GetInstance();
193 #endif 197 #endif
194 #if defined(ENABLE_WEBRTC) 198 #if defined(ENABLE_WEBRTC)
195 // Initialize WebRTC before engaging the sandbox. 199 // Initialize WebRTC before engaging the sandbox.
196 // NOTE: On linux, this call could already have been made from 200 // NOTE: On linux, this call could already have been made from
197 // zygote_main_linux.cc. However, calling multiple times from the same thread 201 // zygote_main_linux.cc. However, calling multiple times from the same thread
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::MessageLoop::current()->Run(); 240 base::MessageLoop::current()->Run();
237 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 241 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
238 } 242 }
239 } 243 }
240 platform.PlatformUninitialize(); 244 platform.PlatformUninitialize();
241 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 245 TRACE_EVENT_END_ETW("RendererMain", 0, "");
242 return 0; 246 return 0;
243 } 247 }
244 248
245 } // namespace content 249 } // namespace content
OLDNEW
« chrome/browser/chrome_browser_main.cc ('K') | « chrome/browser/search/search_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698