| 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 #include "net/base/network_change_notifier_win.h" | 5 #include "net/base/network_change_notifier_win.h" |
| 6 | 6 |
| 7 #include <iphlpapi.h> | 7 #include <iphlpapi.h> |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 void NetworkChangeNotifierWin::SetCurrentConnectionType( | 220 void NetworkChangeNotifierWin::SetCurrentConnectionType( |
| 221 ConnectionType connection_type) { | 221 ConnectionType connection_type) { |
| 222 base::AutoLock auto_lock(last_computed_connection_type_lock_); | 222 base::AutoLock auto_lock(last_computed_connection_type_lock_); |
| 223 last_computed_connection_type_ = connection_type; | 223 last_computed_connection_type_ = connection_type; |
| 224 } | 224 } |
| 225 | 225 |
| 226 void NetworkChangeNotifierWin::OnObjectSignaled(HANDLE object) { | 226 void NetworkChangeNotifierWin::OnObjectSignaled(HANDLE object) { |
| 227 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 227 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
| 228 tracked_objects::ScopedTracker tracking_profile( | 228 tracked_objects::ScopedTracker tracking_profile( |
| 229 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 229 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 230 "NetworkChangeNotifierWin_OnObjectSignaled")); | 230 "418183 NetworkChangeNotifierWin::OnObjectSignaled")); |
| 231 | 231 |
| 232 DCHECK(CalledOnValidThread()); | 232 DCHECK(CalledOnValidThread()); |
| 233 DCHECK(is_watching_); | 233 DCHECK(is_watching_); |
| 234 is_watching_ = false; | 234 is_watching_ = false; |
| 235 | 235 |
| 236 // Start watching for the next address change. | 236 // Start watching for the next address change. |
| 237 WatchForAddressChange(); | 237 WatchForAddressChange(); |
| 238 | 238 |
| 239 NotifyObservers(); | 239 NotifyObservers(); |
| 240 } | 240 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return; | 329 return; |
| 330 } | 330 } |
| 331 if (last_announced_offline_) | 331 if (last_announced_offline_) |
| 332 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); | 332 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); |
| 333 last_announced_offline_ = current_offline; | 333 last_announced_offline_ = current_offline; |
| 334 | 334 |
| 335 NotifyObserversOfConnectionTypeChange(); | 335 NotifyObserversOfConnectionTypeChange(); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace net | 338 } // namespace net |
| OLD | NEW |