| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DnsConfigServiceThread; | 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 // Does the actual work to determine the current connection type. | 60 // Does the actual work to determine the current connection type. |
| 61 // It is not thread safe, see crbug.com/324913. | 61 // It is not thread safe, see crbug.com/324913. |
| 62 virtual ConnectionType RecomputeCurrentConnectionType() const; | 62 virtual ConnectionType RecomputeCurrentConnectionType() const; |
| 63 | 63 |
| 64 void SetCurrentConnectionType(ConnectionType connection_type); | 64 void SetCurrentConnectionType(ConnectionType connection_type); |
| 65 | 65 |
| 66 // Notifies IP address change observers of a change immediately, and notifies | 66 // Notifies IP address change observers of a change immediately, and notifies |
| 67 // network state change observers on a delay. Must only be called on the | 67 // network state change observers on a delay. Must only be called on the |
| 68 // thread |this| was created on. | 68 // thread |this| was created on. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ |
| OLD | NEW |