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

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

Issue 8590003: chrome: Remove 11 exit time destructors and 4 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/callback_old.h" 7 #include "base/callback_old.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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 &CollectNetworkStats, network_stats_server, io_thread)); 532 &CollectNetworkStats, network_stats_server, io_thread));
533 return; 533 return;
534 } 534 }
535 535
536 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 536 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
537 537
538 // Check that there is a network connection. We get called only if UMA upload 538 // Check that there is a network connection. We get called only if UMA upload
539 // to the server has succeeded. 539 // to the server has succeeded.
540 DCHECK(!net::NetworkChangeNotifier::IsOffline()); 540 DCHECK(!net::NetworkChangeNotifier::IsOffline());
541 541
542 static scoped_refptr<base::FieldTrial> trial = NULL; 542 CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::FieldTrial>, trial, (NULL));
Mark Mentovai 2011/11/16 22:54:24 You can use () instead of (NULL) here.
Nico 2011/11/16 22:59:20 Done.
543 static bool collect_stats = false; 543 static bool collect_stats = false;
544 544
545 if (!trial.get()) { 545 if (!trial.get()) {
546 // Set up a field trial to collect network stats for UDP and TCP. 546 // Set up a field trial to collect network stats for UDP and TCP.
547 base::FieldTrial::Probability kDivisor = 1000; 547 base::FieldTrial::Probability kDivisor = 1000;
548 548
549 // Enable the connectivity testing for 0.5% of the users. 549 // Enable the connectivity testing for 0.5% of the users.
550 base::FieldTrial::Probability kProbabilityPerGroup = 5; 550 base::FieldTrial::Probability kProbabilityPerGroup = 5;
551 551
552 // After October 30, 2011 builds, it will always be in default group 552 // After October 30, 2011 builds, it will always be in default group
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 TCPStatsClient* small_tcp_client = new TCPStatsClient(); 596 TCPStatsClient* small_tcp_client = new TCPStatsClient();
597 small_tcp_client->Start( 597 small_tcp_client->Start(
598 host_resolver, tcp_server_address, kSmallTestBytesToSend, NULL); 598 host_resolver, tcp_server_address, kSmallTestBytesToSend, NULL);
599 599
600 TCPStatsClient* large_tcp_client = new TCPStatsClient(); 600 TCPStatsClient* large_tcp_client = new TCPStatsClient();
601 large_tcp_client->Start( 601 large_tcp_client->Start(
602 host_resolver, tcp_server_address, kLargeTestBytesToSend, NULL); 602 host_resolver, tcp_server_address, kLargeTestBytesToSend, NULL);
603 } 603 }
604 604
605 } // namespace chrome_browser_net 605 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698