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

Side by Side Diff: net/base/network_change_notifier.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 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
« no previous file with comments | « media/mojo/services/mojo_renderer_service.h ('k') | net/base/network_change_notifier_win.h » ('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) 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 "net/base/network_change_notifier.h" 5 #include "net/base/network_change_notifier.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 const NetworkChangeCalculatorParams params_; 478 const NetworkChangeCalculatorParams params_;
479 479
480 // Indicates if NotifyObserversOfNetworkChange has been called yet. 480 // Indicates if NotifyObserversOfNetworkChange has been called yet.
481 bool have_announced_; 481 bool have_announced_;
482 // Last value passed to NotifyObserversOfNetworkChange. 482 // Last value passed to NotifyObserversOfNetworkChange.
483 ConnectionType last_announced_connection_type_; 483 ConnectionType last_announced_connection_type_;
484 // Value to pass to NotifyObserversOfNetworkChange when Notify is called. 484 // Value to pass to NotifyObserversOfNetworkChange when Notify is called.
485 ConnectionType pending_connection_type_; 485 ConnectionType pending_connection_type_;
486 // Used to delay notifications so duplicates can be combined. 486 // Used to delay notifications so duplicates can be combined.
487 base::OneShotTimer<NetworkChangeCalculator> timer_; 487 base::OneShotTimer timer_;
488 488
489 base::ThreadChecker thread_checker_; 489 base::ThreadChecker thread_checker_;
490 490
491 DISALLOW_COPY_AND_ASSIGN(NetworkChangeCalculator); 491 DISALLOW_COPY_AND_ASSIGN(NetworkChangeCalculator);
492 }; 492 };
493 493
494 NetworkChangeNotifier::~NetworkChangeNotifier() { 494 NetworkChangeNotifier::~NetworkChangeNotifier() {
495 network_change_calculator_.reset(); 495 network_change_calculator_.reset();
496 DCHECK_EQ(this, g_network_change_notifier); 496 DCHECK_EQ(this, g_network_change_notifier);
497 g_network_change_notifier = NULL; 497 g_network_change_notifier = NULL;
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 1052
1053 NetworkChangeNotifier::DisableForTest::~DisableForTest() { 1053 NetworkChangeNotifier::DisableForTest::~DisableForTest() {
1054 DCHECK(!g_network_change_notifier); 1054 DCHECK(!g_network_change_notifier);
1055 g_network_change_notifier = network_change_notifier_; 1055 g_network_change_notifier = network_change_notifier_;
1056 } 1056 }
1057 1057
1058 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { 1058 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() {
1059 } 1059 }
1060 1060
1061 } // namespace net 1061 } // namespace net
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_renderer_service.h ('k') | net/base/network_change_notifier_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698