| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Forwards connection type notifications to parent class. | 65 // Forwards connection type notifications to parent class. |
| 66 void NotifyParentOfConnectionTypeChange(); | 66 void NotifyParentOfConnectionTypeChange(); |
| 67 | 67 |
| 68 // Tries to start listening for a single subsequent address change. Returns | 68 // Tries to start listening for a single subsequent address change. Returns |
| 69 // false on failure. The caller is responsible for updating |is_watching_|. | 69 // false on failure. The caller is responsible for updating |is_watching_|. |
| 70 // Virtual for unit tests. Must only be called on the thread |this| was | 70 // Virtual for unit tests. Must only be called on the thread |this| was |
| 71 // created on. | 71 // created on. |
| 72 virtual bool WatchForAddressChangeInternal(); | 72 virtual bool WatchForAddressChangeInternal(); |
| 73 | 73 |
| 74 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsWin(); |
| 75 |
| 74 // All member variables may only be accessed on the thread |this| was created | 76 // All member variables may only be accessed on the thread |this| was created |
| 75 // on. | 77 // on. |
| 76 | 78 |
| 77 // False when not currently watching for network change events. This only | 79 // False when not currently watching for network change events. This only |
| 78 // happens on initialization and when WatchForAddressChangeInternal fails and | 80 // happens on initialization and when WatchForAddressChangeInternal fails and |
| 79 // there is a pending task to try again. Needed for safe cleanup. | 81 // there is a pending task to try again. Needed for safe cleanup. |
| 80 bool is_watching_; | 82 bool is_watching_; |
| 81 | 83 |
| 82 base::win::ObjectWatcher addr_watcher_; | 84 base::win::ObjectWatcher addr_watcher_; |
| 83 OVERLAPPED addr_overlapped_; | 85 OVERLAPPED addr_overlapped_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 98 bool last_announced_offline_; | 100 bool last_announced_offline_; |
| 99 // Number of times polled to check if still offline. | 101 // Number of times polled to check if still offline. |
| 100 int offline_polls_; | 102 int offline_polls_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); | 104 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace net | 107 } // namespace net |
| 106 | 108 |
| 107 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ | 109 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ |
| OLD | NEW |