Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: net/base/network_change_notifier_win.cc

Issue 10029001: Update use of TimeDelta in net/*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/base/network_config_watcher_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // retry interval. 197 // retry interval.
198 if (sequential_failures_ == 2000) { 198 if (sequential_failures_ == 2000) {
199 UMA_HISTOGRAM_COUNTS_10000("Net.NotifyAddrChangeFailures", 199 UMA_HISTOGRAM_COUNTS_10000("Net.NotifyAddrChangeFailures",
200 sequential_failures_); 200 sequential_failures_);
201 } 201 }
202 202
203 MessageLoop::current()->PostDelayedTask( 203 MessageLoop::current()->PostDelayedTask(
204 FROM_HERE, 204 FROM_HERE,
205 base::Bind(&NetworkChangeNotifierWin::WatchForAddressChange, 205 base::Bind(&NetworkChangeNotifierWin::WatchForAddressChange,
206 weak_factory_.GetWeakPtr()), 206 weak_factory_.GetWeakPtr()),
207 kWatchForAddressChangeRetryIntervalMs); 207 base::TimeDelta::FromMilliseconds(
208 kWatchForAddressChangeRetryIntervalMs));
208 return; 209 return;
209 } 210 }
210 211
211 // Treat the transition from NotifyAddrChange failing to succeeding as a 212 // Treat the transition from NotifyAddrChange failing to succeeding as a
212 // network change event, since network changes were not being observed in 213 // network change event, since network changes were not being observed in
213 // that interval. 214 // that interval.
214 if (sequential_failures_ > 0) 215 if (sequential_failures_ > 0)
215 NotifyObservers(); 216 NotifyObservers();
216 217
217 if (sequential_failures_ < 2000) { 218 if (sequential_failures_ < 2000) {
(...skipping 14 matching lines...) Expand all
232 233
233 addr_watcher_.StartWatching(addr_overlapped_.hEvent, this); 234 addr_watcher_.StartWatching(addr_overlapped_.hEvent, this);
234 return true; 235 return true;
235 } 236 }
236 237
237 void NetworkChangeNotifierWin::NotifyParentOfOnlineStateChange() { 238 void NetworkChangeNotifierWin::NotifyParentOfOnlineStateChange() {
238 NotifyObserversOfOnlineStateChange(); 239 NotifyObserversOfOnlineStateChange();
239 } 240 }
240 241
241 } // namespace net 242 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/network_config_watcher_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698