| 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 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 #include "net/base/network_change_notifier.h" | 13 #include "net/base/network_change_notifier.h" |
| 14 | 14 |
| 15 namespace dbus { | 15 namespace dbus { |
| 16 class Bus; | 16 class Bus; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace internal { |
| 22 class AddressTrackerLinux; |
| 23 } |
| 24 |
| 21 class NET_EXPORT_PRIVATE NetworkChangeNotifierLinux | 25 class NET_EXPORT_PRIVATE NetworkChangeNotifierLinux |
| 22 : public NetworkChangeNotifier { | 26 : public NetworkChangeNotifier { |
| 23 public: | 27 public: |
| 24 static NetworkChangeNotifierLinux* Create(); | 28 static NetworkChangeNotifierLinux* Create(); |
| 25 | 29 |
| 26 // Unittests inject a mock bus. | 30 // Unittests inject a mock bus. |
| 27 static NetworkChangeNotifierLinux* CreateForTest(dbus::Bus* bus); | 31 static NetworkChangeNotifierLinux* CreateForTest(dbus::Bus* bus); |
| 28 | 32 |
| 29 private: | 33 private: |
| 30 class Thread; | 34 class Thread; |
| 31 | 35 |
| 32 explicit NetworkChangeNotifierLinux(dbus::Bus* bus); | 36 explicit NetworkChangeNotifierLinux(dbus::Bus* bus); |
| 33 virtual ~NetworkChangeNotifierLinux(); | 37 virtual ~NetworkChangeNotifierLinux(); |
| 34 | 38 |
| 35 // NetworkChangeNotifier: | 39 // NetworkChangeNotifier: |
| 36 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; | 40 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; |
| 37 | 41 |
| 38 // The thread used to listen for notifications. This relays the notification | 42 // The thread used to listen for notifications. This relays the notification |
| 39 // to the registered observers without posting back to the thread the object | 43 // to the registered observers without posting back to the thread the object |
| 40 // was created on. | 44 // was created on. |
| 41 // Also used for DnsConfigWatcher which requires TYPE_IO message loop. | 45 // Also used for DnsConfigWatcher which requires TYPE_IO message loop. |
| 42 scoped_ptr<Thread> notifier_thread_; | 46 scoped_ptr<Thread> notifier_thread_; |
| 43 | 47 |
| 44 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); | 48 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace net | 51 } // namespace net |
| 48 | 52 |
| 49 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 53 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| OLD | NEW |