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 19 matching lines...) Expand all Loading... |
30 // Thread on which we can run DnsConfigService, which requires AssertIOAllowed | 30 // Thread on which we can run DnsConfigService, which requires AssertIOAllowed |
31 // to open registry keys and to handle FilePathWatcher updates. | 31 // to open registry keys and to handle FilePathWatcher updates. |
32 class NetworkChangeNotifierWin::DnsConfigServiceThread : public base::Thread { | 32 class NetworkChangeNotifierWin::DnsConfigServiceThread : public base::Thread { |
33 public: | 33 public: |
34 DnsConfigServiceThread() : base::Thread("DnsConfigService") {} | 34 DnsConfigServiceThread() : base::Thread("DnsConfigService") {} |
35 | 35 |
36 virtual ~DnsConfigServiceThread() { | 36 virtual ~DnsConfigServiceThread() { |
37 Stop(); | 37 Stop(); |
38 } | 38 } |
39 | 39 |
40 virtual void Init() OVERRIDE { | 40 virtual void Init() override { |
41 service_ = DnsConfigService::CreateSystemService(); | 41 service_ = DnsConfigService::CreateSystemService(); |
42 service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig)); | 42 service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig)); |
43 } | 43 } |
44 | 44 |
45 virtual void CleanUp() OVERRIDE { | 45 virtual void CleanUp() override { |
46 service_.reset(); | 46 service_.reset(); |
47 } | 47 } |
48 | 48 |
49 private: | 49 private: |
50 scoped_ptr<DnsConfigService> service_; | 50 scoped_ptr<DnsConfigService> service_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); | 52 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); |
53 }; | 53 }; |
54 | 54 |
55 NetworkChangeNotifierWin::NetworkChangeNotifierWin() | 55 NetworkChangeNotifierWin::NetworkChangeNotifierWin() |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 return; | 324 return; |
325 } | 325 } |
326 if (last_announced_offline_) | 326 if (last_announced_offline_) |
327 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); | 327 UMA_HISTOGRAM_CUSTOM_COUNTS("NCN.OfflinePolls", offline_polls_, 1, 50, 50); |
328 last_announced_offline_ = current_offline; | 328 last_announced_offline_ = current_offline; |
329 | 329 |
330 NotifyObserversOfConnectionTypeChange(); | 330 NotifyObserversOfConnectionTypeChange(); |
331 } | 331 } |
332 | 332 |
333 } // namespace net | 333 } // namespace net |
OLD | NEW |