OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_THREAD_H_ | |
6 #define CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_THREAD_H_ | |
7 | |
8 // A simple interface that represents a thread which owns a | |
9 // NetworkChangeNotifier. | |
10 | |
11 class MessageLoop; | |
12 | |
13 namespace net { | |
14 class NetworkChangeNotifier; | |
15 } // namespace net | |
16 | |
17 namespace chrome_common_net { | |
18 | |
19 // An instance of this interface must live no longer than the thread | |
20 // it represents and its message loop and network change notifier. | |
21 class NetworkChangeNotifierThread { | |
22 public: | |
23 virtual ~NetworkChangeNotifierThread() {} | |
24 | |
25 // Returns the message loop for the thread that owns the | |
26 // NetworkChangeNotifier. Can be called on any thread. | |
27 virtual MessageLoop* GetMessageLoop() const = 0; | |
28 | |
29 // Returns the NetworkChangeNotifier of the thread. This method | |
30 // must be called only from the owning thread (i.e., by posting a | |
31 // task onto the message loop returned by GetMessageLoop()). | |
32 virtual net::NetworkChangeNotifier* GetNetworkChangeNotifier() const = 0; | |
33 }; | |
34 | |
35 } // namespace chrome_common_net | |
36 | |
37 #endif // CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_THREAD_H_ | |
OLD | NEW |