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 #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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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<NetworkChangeNotifierWin> 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 // Used for calling WatchForAddressChange again on failure. | |
99 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_; | |
100 | |
101 // Thread on which we can run DnsConfigService. | 98 // Thread on which we can run DnsConfigService. |
102 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 99 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
103 | 100 |
104 mutable base::Lock last_computed_connection_type_lock_; | 101 mutable base::Lock last_computed_connection_type_lock_; |
105 ConnectionType last_computed_connection_type_; | 102 ConnectionType last_computed_connection_type_; |
106 | 103 |
107 // Result of IsOffline() when NotifyObserversOfConnectionTypeChange() | 104 // Result of IsOffline() when NotifyObserversOfConnectionTypeChange() |
108 // was last called. | 105 // was last called. |
109 bool last_announced_offline_; | 106 bool last_announced_offline_; |
110 // Number of times polled to check if still offline. | 107 // Number of times polled to check if still offline. |
111 int offline_polls_; | 108 int offline_polls_; |
112 | 109 |
| 110 // Used for calling WatchForAddressChange again on failure. |
| 111 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_; |
| 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_ |
OLD | NEW |