OLD | NEW |
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 const base::FieldTrial::Probability kDivisor = 100; | 462 const base::FieldTrial::Probability kDivisor = 100; |
463 base::FieldTrial::Probability probability_to_run_test = 0; | 463 base::FieldTrial::Probability probability_to_run_test = 0; |
464 | 464 |
465 const char* kTrialName = "HttpPipeliningCompatibility"; | 465 const char* kTrialName = "HttpPipeliningCompatibility"; |
466 base::FieldTrial* trial = base::FieldTrialList::Find(kTrialName); | 466 base::FieldTrial* trial = base::FieldTrialList::Find(kTrialName); |
467 if (trial) { | 467 if (trial) { |
468 return; | 468 return; |
469 } | 469 } |
470 // After April 14, 2012, the trial will disable itself. | 470 // After April 14, 2012, the trial will disable itself. |
471 trial = new base::FieldTrial(kTrialName, kDivisor, | 471 trial = base::FieldTrialList::FactoryGetFieldTrial( |
472 "disable_test", 2012, 4, 14); | 472 kTrialName, kDivisor, "disable_test", 2012, 4, 14, NULL); |
473 | 473 |
474 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 474 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
475 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { | 475 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { |
476 // TODO(simonjam): Re-enable this when crash is fixed. | 476 // TODO(simonjam): Re-enable this when crash is fixed. |
477 probability_to_run_test = 0; | 477 probability_to_run_test = 0; |
478 } | 478 } |
479 | 479 |
480 int collect_stats_group = trial->AppendGroup("enable_test", | 480 int collect_stats_group = trial->AppendGroup("enable_test", |
481 probability_to_run_test); | 481 probability_to_run_test); |
482 if (trial->group() != collect_stats_group) { | 482 if (trial->group() != collect_stats_group) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 content::BrowserThread::PostTask( | 529 content::BrowserThread::PostTask( |
530 content::BrowserThread::IO, | 530 content::BrowserThread::IO, |
531 FROM_HERE, | 531 FROM_HERE, |
532 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, | 532 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, |
533 pipeline_test_server, | 533 pipeline_test_server, |
534 make_scoped_refptr( | 534 make_scoped_refptr( |
535 io_thread->system_url_request_context_getter()))); | 535 io_thread->system_url_request_context_getter()))); |
536 } | 536 } |
537 | 537 |
538 } // namespace chrome_browser_net | 538 } // namespace chrome_browser_net |
OLD | NEW |