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

Side by Side Diff: chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc

Issue 6213001: disable field trials if the build is 30 days or older (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « base/metrics/field_trial_unittest.cc ('k') | chrome/renderer/render_thread.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" 5 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 13 matching lines...) Expand all
24 // Hold reference while experiment is running. 24 // Hold reference while experiment is running.
25 static scoped_refptr<WebSocketExperimentRunner> runner; 25 static scoped_refptr<WebSocketExperimentRunner> runner;
26 26
27 /* static */ 27 /* static */
28 void WebSocketExperimentRunner::Start() { 28 void WebSocketExperimentRunner::Start() {
29 DCHECK(!runner.get()); 29 DCHECK(!runner.get());
30 30
31 scoped_refptr<base::FieldTrial> trial( 31 scoped_refptr<base::FieldTrial> trial(
32 new base::FieldTrial("WebSocketExperiment", 1000)); 32 new base::FieldTrial("WebSocketExperiment", 1000));
33 trial->AppendGroup("active", 5); // 0.5% in active group. 33 trial->AppendGroup("active", 5); // 0.5% in active group.
34 trial->AppendGroup("default", base::FieldTrial::kAllRemainingProbability);
34 35
35 bool run_experiment = 36 bool run_experiment =
36 (trial->group() != base::FieldTrial::kNotParticipating); 37 (trial->group() != base::FieldTrial::kNotParticipating);
37 #ifndef NDEBUG 38 #ifndef NDEBUG
38 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 39 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
39 std::string experiment_host = command_line.GetSwitchValueASCII( 40 std::string experiment_host = command_line.GetSwitchValueASCII(
40 switches::kWebSocketLiveExperimentHost); 41 switches::kWebSocketLiveExperimentHost);
41 if (!experiment_host.empty()) 42 if (!experiment_host.empty())
42 run_experiment = true; 43 run_experiment = true;
43 #else 44 #else
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 Release(); 227 Release();
227 return; 228 return;
228 } 229 }
229 task_->SaveResult(); 230 task_->SaveResult();
230 task_.reset(); 231 task_.reset();
231 232
232 DoLoop(); 233 DoLoop();
233 } 234 }
234 235
235 } // namespace chrome_browser_net_websocket_experiment 236 } // namespace chrome_browser_net_websocket_experiment
OLDNEW
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698