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

Side by Side Diff: chrome/browser/net/http_pipelining_compatibility_client.cc

Issue 9705074: Supporting command line argument to force field trials (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No more static default group number Created 8 years, 8 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
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 "chrome/browser/net/http_pipelining_compatibility_client.h" 5 #include "chrome/browser/net/http_pipelining_compatibility_client.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 const base::FieldTrial::Probability kDivisor = 100; 300 const base::FieldTrial::Probability kDivisor = 100;
301 base::FieldTrial::Probability probability_to_run_test = 0; 301 base::FieldTrial::Probability probability_to_run_test = 0;
302 302
303 const char* kTrialName = "HttpPipeliningCompatibility"; 303 const char* kTrialName = "HttpPipeliningCompatibility";
304 base::FieldTrial* trial = base::FieldTrialList::Find(kTrialName); 304 base::FieldTrial* trial = base::FieldTrialList::Find(kTrialName);
305 if (trial) { 305 if (trial) {
306 return; 306 return;
307 } 307 }
308 // After April 1, 2012, the trial will disable itself. 308 // After April 1, 2012, the trial will disable itself.
309 trial = new base::FieldTrial(kTrialName, kDivisor, 309 trial = base::FieldTrialList::GetFieldTrialInstance(
310 "disable_test", 2012, 4, 1); 310 kTrialName, kDivisor, "disable_test", NULL, 2012, 4, 1);
311 311
312 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 312 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
313 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { 313 if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
314 probability_to_run_test = 20; 314 probability_to_run_test = 20;
315 } 315 }
316 316
317 int collect_stats_group = trial->AppendGroup("enable_test", 317 int collect_stats_group = trial->AppendGroup("enable_test",
318 probability_to_run_test); 318 probability_to_run_test);
319 if (trial->group() != collect_stats_group) { 319 if (trial->group() != collect_stats_group) {
320 return; 320 return;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 content::BrowserThread::PostTask( 365 content::BrowserThread::PostTask(
366 content::BrowserThread::IO, 366 content::BrowserThread::IO,
367 FROM_HERE, 367 FROM_HERE,
368 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, 368 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread,
369 pipeline_test_server, 369 pipeline_test_server,
370 make_scoped_refptr( 370 make_scoped_refptr(
371 io_thread->system_url_request_context_getter()))); 371 io_thread->system_url_request_context_getter())));
372 } 372 }
373 373
374 } // namespace chrome_browser_net 374 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698