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

Side by Side Diff: net/base/network_change_notifier_win.h

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, 3 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 | « net/base/network_change_notifier.cc ('k') | net/cert_net/cert_net_fetcher_impl.cc » ('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 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // on. 83 // on.
84 84
85 // False when not currently watching for network change events. This only 85 // False when not currently watching for network change events. This only
86 // happens on initialization and when WatchForAddressChangeInternal fails and 86 // happens on initialization and when WatchForAddressChangeInternal fails and
87 // there is a pending task to try again. Needed for safe cleanup. 87 // there is a pending task to try again. Needed for safe cleanup.
88 bool is_watching_; 88 bool is_watching_;
89 89
90 base::win::ObjectWatcher addr_watcher_; 90 base::win::ObjectWatcher addr_watcher_;
91 OVERLAPPED addr_overlapped_; 91 OVERLAPPED addr_overlapped_;
92 92
93 base::OneShotTimer<NetworkChangeNotifierWin> timer_; 93 base::OneShotTimer timer_;
94 94
95 // Number of times WatchForAddressChange has failed in a row. 95 // Number of times WatchForAddressChange has failed in a row.
96 int sequential_failures_; 96 int sequential_failures_;
97 97
98 // Thread on which we can run DnsConfigService. 98 // Thread on which we can run DnsConfigService.
99 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; 99 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_;
100 100
101 mutable base::Lock last_computed_connection_type_lock_; 101 mutable base::Lock last_computed_connection_type_lock_;
102 ConnectionType last_computed_connection_type_; 102 ConnectionType last_computed_connection_type_;
103 103
104 // Result of IsOffline() when NotifyObserversOfConnectionTypeChange() 104 // Result of IsOffline() when NotifyObserversOfConnectionTypeChange()
105 // was last called. 105 // was last called.
106 bool last_announced_offline_; 106 bool last_announced_offline_;
107 // Number of times polled to check if still offline. 107 // Number of times polled to check if still offline.
108 int offline_polls_; 108 int offline_polls_;
109 109
110 // Used for calling WatchForAddressChange again on failure. 110 // Used for calling WatchForAddressChange again on failure.
111 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_; 111 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_;
112 112
113 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); 113 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin);
114 }; 114 };
115 115
116 } // namespace net 116 } // namespace net
117 117
118 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 118 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
OLDNEW
« no previous file with comments | « net/base/network_change_notifier.cc ('k') | net/cert_net/cert_net_fetcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698