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 // 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class P2PSocketClientImpl; | 49 class P2PSocketClientImpl; |
50 class RenderViewImpl; | 50 class RenderViewImpl; |
51 | 51 |
52 class CONTENT_EXPORT P2PSocketDispatcher : public IPC::MessageFilter, | 52 class CONTENT_EXPORT P2PSocketDispatcher : public IPC::MessageFilter, |
53 public NetworkListManager { | 53 public NetworkListManager { |
54 public: | 54 public: |
55 explicit P2PSocketDispatcher(base::MessageLoopProxy* ipc_message_loop); | 55 explicit P2PSocketDispatcher(base::MessageLoopProxy* ipc_message_loop); |
56 | 56 |
57 // NetworkListManager interface: | 57 // NetworkListManager interface: |
58 virtual void AddNetworkListObserver( | 58 virtual void AddNetworkListObserver( |
59 NetworkListObserver* network_list_observer) OVERRIDE; | 59 NetworkListObserver* network_list_observer) override; |
60 virtual void RemoveNetworkListObserver( | 60 virtual void RemoveNetworkListObserver( |
61 NetworkListObserver* network_list_observer) OVERRIDE; | 61 NetworkListObserver* network_list_observer) override; |
62 | 62 |
63 protected: | 63 protected: |
64 virtual ~P2PSocketDispatcher(); | 64 virtual ~P2PSocketDispatcher(); |
65 | 65 |
66 private: | 66 private: |
67 friend class P2PAsyncAddressResolver; | 67 friend class P2PAsyncAddressResolver; |
68 friend class P2PSocketClientImpl; | 68 friend class P2PSocketClientImpl; |
69 | 69 |
70 // Send a message asynchronously. | 70 // Send a message asynchronously. |
71 virtual void Send(IPC::Message* message); | 71 virtual void Send(IPC::Message* message); |
72 | 72 |
73 // IPC::MessageFilter override. Called on IO thread. | 73 // IPC::MessageFilter override. Called on IO thread. |
74 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 74 virtual bool OnMessageReceived(const IPC::Message& message) override; |
75 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 75 virtual void OnFilterAdded(IPC::Sender* sender) override; |
76 virtual void OnFilterRemoved() OVERRIDE; | 76 virtual void OnFilterRemoved() override; |
77 virtual void OnChannelClosing() OVERRIDE; | 77 virtual void OnChannelClosing() override; |
78 | 78 |
79 // Returns the IO message loop. | 79 // Returns the IO message loop. |
80 base::MessageLoopProxy* message_loop(); | 80 base::MessageLoopProxy* message_loop(); |
81 | 81 |
82 // Called by P2PSocketClient. | 82 // Called by P2PSocketClient. |
83 int RegisterClient(P2PSocketClientImpl* client); | 83 int RegisterClient(P2PSocketClientImpl* client); |
84 void UnregisterClient(int id); | 84 void UnregisterClient(int id); |
85 void SendP2PMessage(IPC::Message* msg); | 85 void SendP2PMessage(IPC::Message* msg); |
86 | 86 |
87 // Called by DnsRequest. | 87 // Called by DnsRequest. |
(...skipping 26 matching lines...) Expand all Loading... |
114 network_list_observers_; | 114 network_list_observers_; |
115 | 115 |
116 IPC::Sender* sender_; | 116 IPC::Sender* sender_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); | 118 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace content | 121 } // namespace content |
122 | 122 |
123 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ | 123 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ |
OLD | NEW |