| 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/network_stats.h" | 5 #include "chrome/browser/net/network_stats.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 | 543 |
| 544 // Enable the connectivity testing for 0.5% of the users. | 544 // Enable the connectivity testing for 0.5% of the users. |
| 545 base::FieldTrial::Probability probability_per_group = 5; | 545 base::FieldTrial::Probability probability_per_group = 5; |
| 546 | 546 |
| 547 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 547 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 548 if (channel == chrome::VersionInfo::CHANNEL_CANARY) | 548 if (channel == chrome::VersionInfo::CHANNEL_CANARY) |
| 549 probability_per_group = kDivisor; | 549 probability_per_group = kDivisor; |
| 550 | 550 |
| 551 // After October 30, 2012 builds, it will always be in default group | 551 // After October 30, 2012 builds, it will always be in default group |
| 552 // (disable_network_stats). | 552 // (disable_network_stats). |
| 553 trial = new base::FieldTrial("NetworkConnectivity", kDivisor, | 553 trial = base::FieldTrial::CreateInstance( |
| 554 "disable_network_stats", 2012, 10, 30); | 554 "NetworkConnectivity", kDivisor, "disable_network_stats", 2012, 10, 30); |
| 555 | 555 |
| 556 // Add option to collect_stats for NetworkConnectivity. | 556 // Add option to collect_stats for NetworkConnectivity. |
| 557 int collect_stats_group = trial->AppendGroup("collect_stats", | 557 int collect_stats_group = trial->AppendGroup("collect_stats", |
| 558 probability_per_group); | 558 probability_per_group); |
| 559 if (trial->group() == collect_stats_group) | 559 if (trial->group() == collect_stats_group) |
| 560 collect_stats = true; | 560 collect_stats = true; |
| 561 } | 561 } |
| 562 | 562 |
| 563 if (!collect_stats) | 563 if (!collect_stats) |
| 564 return; | 564 return; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 host_resolver, tcp_server_address, kSmallTestBytesToSend, | 598 host_resolver, tcp_server_address, kSmallTestBytesToSend, |
| 599 net::CompletionCallback()); | 599 net::CompletionCallback()); |
| 600 | 600 |
| 601 TCPStatsClient* large_tcp_client = new TCPStatsClient(); | 601 TCPStatsClient* large_tcp_client = new TCPStatsClient(); |
| 602 large_tcp_client->Start( | 602 large_tcp_client->Start( |
| 603 host_resolver, tcp_server_address, kLargeTestBytesToSend, | 603 host_resolver, tcp_server_address, kLargeTestBytesToSend, |
| 604 net::CompletionCallback()); | 604 net::CompletionCallback()); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace chrome_browser_net | 607 } // namespace chrome_browser_net |
| OLD | NEW |