OLD | NEW |
---|---|
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 #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/network_change_notifier.h" | 12 #include "net/base/network_change_notifier.h" |
13 | 13 |
14 namespace dbus { | |
15 class Bus; | |
16 } | |
17 | |
14 namespace net { | 18 namespace net { |
15 | 19 |
16 class NetworkChangeNotifierLinux : public NetworkChangeNotifier { | 20 class NetworkChangeNotifierLinux : public NetworkChangeNotifier { |
17 public: | 21 public: |
18 NetworkChangeNotifierLinux(); | 22 NetworkChangeNotifierLinux(); |
23 virtual ~NetworkChangeNotifierLinux(); | |
24 | |
25 protected: | |
26 // For testing. | |
27 explicit NetworkChangeNotifierLinux(dbus::Bus* bus); | |
satorux1
2011/10/26 17:37:09
Function overloading is prohibited per our style g
adamk
2011/10/26 18:35:52
My reading of that section is not to prohibit oper
satorux1
2011/10/26 18:53:15
Let's go with 1).
adamk
2011/10/26 19:09:34
Actually, there's only one caller in production co
| |
28 | |
29 // NetworkChangeNotifier implementation. | |
30 // Protected for testing. | |
31 virtual bool IsCurrentlyOffline() const OVERRIDE; | |
19 | 32 |
20 private: | 33 private: |
21 class Thread; | 34 class Thread; |
22 | 35 |
23 virtual ~NetworkChangeNotifierLinux(); | |
24 | |
25 // NetworkChangeNotifier: | |
26 virtual bool IsCurrentlyOffline() const OVERRIDE; | |
27 | |
28 // The thread used to listen for notifications. This relays the notification | 36 // The thread used to listen for notifications. This relays the notification |
29 // to the registered observers without posting back to the thread the object | 37 // to the registered observers without posting back to the thread the object |
30 // was created on. | 38 // was created on. |
31 scoped_ptr<Thread> notifier_thread_; | 39 scoped_ptr<Thread> notifier_thread_; |
32 | 40 |
33 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); | 41 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); |
34 }; | 42 }; |
35 | 43 |
36 } // namespace net | 44 } // namespace net |
37 | 45 |
38 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 46 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
OLD | NEW |