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 // P2PSocketDispatcher is a per-renderer object that dispatchers all | 5 // P2PSocketDispatcher is a per-renderer object that dispatchers all |
6 // P2P messages received from the browser and relays all P2P messages | 6 // P2P messages received from the browser and relays all P2P messages |
7 // sent to the browser. P2PSocketClient instances register themselves | 7 // sent to the browser. P2PSocketClient instances register themselves |
8 // with the dispatcher using RegisterClient() and UnregisterClient(). | 8 // with the dispatcher using RegisterClient() and UnregisterClient(). |
9 // | 9 // |
10 // Relationship of classes. | 10 // Relationship of classes. |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #include "base/callback.h" | 24 #include "base/callback.h" |
25 #include "base/compiler_specific.h" | 25 #include "base/compiler_specific.h" |
26 #include "base/id_map.h" | 26 #include "base/id_map.h" |
27 #include "base/observer_list_threadsafe.h" | 27 #include "base/observer_list_threadsafe.h" |
28 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
29 #include "content/common/p2p_sockets.h" | 29 #include "content/common/p2p_sockets.h" |
30 #include "content/public/renderer/render_view_observer.h" | 30 #include "content/public/renderer/render_view_observer.h" |
31 #include "net/base/net_util.h" | 31 #include "net/base/net_util.h" |
32 | 32 |
| 33 class RenderViewImpl; |
| 34 |
33 namespace base { | 35 namespace base { |
34 class MessageLoopProxy; | 36 class MessageLoopProxy; |
35 } // namespace base | 37 } // namespace base |
36 | 38 |
37 namespace net { | 39 namespace net { |
38 class IPEndPoint; | 40 class IPEndPoint; |
39 } // namespace net | 41 } // namespace net |
40 | 42 |
41 namespace content { | 43 namespace content { |
42 | 44 |
(...skipping 12 matching lines...) Expand all Loading... |
55 virtual void OnNetworkListChanged( | 57 virtual void OnNetworkListChanged( |
56 const net::NetworkInterfaceList& list) = 0; | 58 const net::NetworkInterfaceList& list) = 0; |
57 | 59 |
58 protected: | 60 protected: |
59 NetworkListObserver() { } | 61 NetworkListObserver() { } |
60 | 62 |
61 private: | 63 private: |
62 DISALLOW_COPY_AND_ASSIGN(NetworkListObserver); | 64 DISALLOW_COPY_AND_ASSIGN(NetworkListObserver); |
63 }; | 65 }; |
64 | 66 |
65 explicit P2PSocketDispatcher(RenderView* render_view); | 67 explicit P2PSocketDispatcher(RenderViewImpl* render_view); |
66 virtual ~P2PSocketDispatcher(); | 68 virtual ~P2PSocketDispatcher(); |
67 | 69 |
68 // Add a new network list observer. Each observer is called | 70 // Add a new network list observer. Each observer is called |
69 // immidiately after its't registered and then later whenever | 71 // immidiately after its't registered and then later whenever |
70 // network configuration changes. | 72 // network configuration changes. |
71 void AddNetworkListObserver(NetworkListObserver* network_list_observer); | 73 void AddNetworkListObserver(NetworkListObserver* network_list_observer); |
72 | 74 |
73 // Removes network list observer. | 75 // Removes network list observer. |
74 void RemoveNetworkListObserver(NetworkListObserver* network_list_observer); | 76 void RemoveNetworkListObserver(NetworkListObserver* network_list_observer); |
75 | 77 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool network_notifications_started_; | 113 bool network_notifications_started_; |
112 scoped_refptr<ObserverListThreadSafe<NetworkListObserver> > | 114 scoped_refptr<ObserverListThreadSafe<NetworkListObserver> > |
113 network_list_observers_; | 115 network_list_observers_; |
114 | 116 |
115 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); | 117 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); |
116 }; | 118 }; |
117 | 119 |
118 } // namespace content | 120 } // namespace content |
119 | 121 |
120 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ | 122 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ |
OLD | NEW |