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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 service_.reset(); | 45 service_.reset(); |
46 } | 46 } |
47 | 47 |
48 private: | 48 private: |
49 scoped_ptr<DnsConfigService> service_; | 49 scoped_ptr<DnsConfigService> service_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); | 51 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); |
52 }; | 52 }; |
53 | 53 |
54 NetworkChangeNotifierWin::NetworkChangeNotifierWin() | 54 NetworkChangeNotifierWin::NetworkChangeNotifierWin() |
55 : is_watching_(false), | 55 : NetworkChangeNotifier(1500, 1500, 1500, 500), |
| 56 is_watching_(false), |
56 sequential_failures_(0), | 57 sequential_failures_(0), |
57 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 58 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
58 dns_config_service_thread_(new DnsConfigServiceThread()), | 59 dns_config_service_thread_(new DnsConfigServiceThread()), |
59 last_announced_offline_(IsOffline()) { | 60 last_announced_offline_(IsOffline()) { |
60 memset(&addr_overlapped_, 0, sizeof addr_overlapped_); | 61 memset(&addr_overlapped_, 0, sizeof addr_overlapped_); |
61 addr_overlapped_.hEvent = WSACreateEvent(); | 62 addr_overlapped_.hEvent = WSACreateEvent(); |
62 dns_config_service_thread_->StartWithOptions( | 63 dns_config_service_thread_->StartWithOptions( |
63 base::Thread::Options(MessageLoop::TYPE_IO, 0)); | 64 base::Thread::Options(MessageLoop::TYPE_IO, 0)); |
64 } | 65 } |
65 | 66 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 return; | 287 return; |
287 } | 288 } |
288 if (last_announced_offline_) | 289 if (last_announced_offline_) |
289 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); | 290 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); |
290 last_announced_offline_ = current_offline; | 291 last_announced_offline_ = current_offline; |
291 | 292 |
292 NotifyObserversOfConnectionTypeChange(); | 293 NotifyObserversOfConnectionTypeChange(); |
293 } | 294 } |
294 | 295 |
295 } // namespace net | 296 } // namespace net |
OLD | NEW |