| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 virtual ~NetworkChangeNotifierWin(); | 42 virtual ~NetworkChangeNotifierWin(); |
| 43 | 43 |
| 44 // For unit tests only. | 44 // For unit tests only. |
| 45 bool is_watching() { return is_watching_; } | 45 bool is_watching() { return is_watching_; } |
| 46 void set_is_watching(bool is_watching) { is_watching_ = is_watching; } | 46 void set_is_watching(bool is_watching) { is_watching_ = is_watching; } |
| 47 int sequential_failures() { return sequential_failures_; } | 47 int sequential_failures() { return sequential_failures_; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 class DnsWatcherThread; | 50 class DnsConfigServiceThread; |
| 51 friend class NetworkChangeNotifierWinTest; | 51 friend class NetworkChangeNotifierWinTest; |
| 52 | 52 |
| 53 // NetworkChangeNotifier methods: | 53 // NetworkChangeNotifier methods: |
| 54 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; | 54 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; |
| 55 | 55 |
| 56 // ObjectWatcher::Delegate methods: | 56 // ObjectWatcher::Delegate methods: |
| 57 // Must only be called on the thread |this| was created on. | 57 // Must only be called on the thread |this| was created on. |
| 58 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; | 58 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; |
| 59 | 59 |
| 60 // Notifies IP address change observers of a change immediately, and notifies | 60 // Notifies IP address change observers of a change immediately, and notifies |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 OVERLAPPED addr_overlapped_; | 83 OVERLAPPED addr_overlapped_; |
| 84 | 84 |
| 85 base::OneShotTimer<NetworkChangeNotifierWin> timer_; | 85 base::OneShotTimer<NetworkChangeNotifierWin> timer_; |
| 86 | 86 |
| 87 // Number of times WatchForAddressChange has failed in a row. | 87 // Number of times WatchForAddressChange has failed in a row. |
| 88 int sequential_failures_; | 88 int sequential_failures_; |
| 89 | 89 |
| 90 // Used for calling WatchForAddressChange again on failure. | 90 // Used for calling WatchForAddressChange again on failure. |
| 91 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_; | 91 base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_; |
| 92 | 92 |
| 93 // Thread on which we can run DnsConfigWatcher. | 93 // Thread on which we can run DnsConfigService. |
| 94 scoped_ptr<DnsWatcherThread> dns_watcher_thread_; | 94 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); | 96 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace net | 99 } // namespace net |
| 100 | 100 |
| 101 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ | 101 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ |
| OLD | NEW |