| 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_mac.h" | 5 #include "net/base/network_change_notifier_mac.h" |
| 6 | 6 |
| 7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
| 8 #include <resolv.h> | 8 #include <resolv.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // Thread on which we can run DnsConfigService, which requires a TYPE_IO | 40 // Thread on which we can run DnsConfigService, which requires a TYPE_IO |
| 41 // message loop. | 41 // message loop. |
| 42 class NetworkChangeNotifierMac::DnsConfigServiceThread : public base::Thread { | 42 class NetworkChangeNotifierMac::DnsConfigServiceThread : public base::Thread { |
| 43 public: | 43 public: |
| 44 DnsConfigServiceThread() : base::Thread("DnsConfigService") {} | 44 DnsConfigServiceThread() : base::Thread("DnsConfigService") {} |
| 45 | 45 |
| 46 virtual ~DnsConfigServiceThread() { | 46 virtual ~DnsConfigServiceThread() { |
| 47 Stop(); | 47 Stop(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual void Init() OVERRIDE { | 50 virtual void Init() override { |
| 51 service_ = DnsConfigService::CreateSystemService(); | 51 service_ = DnsConfigService::CreateSystemService(); |
| 52 service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig)); | 52 service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual void CleanUp() OVERRIDE { | 55 virtual void CleanUp() override { |
| 56 service_.reset(); | 56 service_.reset(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 scoped_ptr<DnsConfigService> service_; | 60 scoped_ptr<DnsConfigService> service_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); | 62 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 NetworkChangeNotifierMac::NetworkChangeNotifierMac() | 65 NetworkChangeNotifierMac::NetworkChangeNotifierMac() |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 NotifyObserversOfConnectionTypeChange(); | 263 NotifyObserversOfConnectionTypeChange(); |
| 264 | 264 |
| 265 #if defined(OS_IOS) | 265 #if defined(OS_IOS) |
| 266 // On iOS, the SCDynamicStore API does not exist, and we use the reachability | 266 // On iOS, the SCDynamicStore API does not exist, and we use the reachability |
| 267 // API to detect IP address changes instead. | 267 // API to detect IP address changes instead. |
| 268 NotifyObserversOfIPAddressChange(); | 268 NotifyObserversOfIPAddressChange(); |
| 269 #endif // defined(OS_IOS) | 269 #endif // defined(OS_IOS) |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace net | 272 } // namespace net |
| OLD | NEW |