Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Side by Side Diff: content/renderer/p2p/socket_dispatcher.h

Issue 10093012: Update comments in socket_dispatcher.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 // 11 //
12 // P2PSocketHost P2PSocketClient 12 // P2PSocketHost P2PSocketClient
13 // ^ ^ 13 // ^ ^
14 // | | 14 // | |
15 // v IPC v 15 // v IPC v
16 // P2PSocketDispatcherHost <---------> P2PSocketDispatcher 16 // P2PSocketDispatcherHost <---------> P2PSocketDispatcher
17 // 17 //
18 // P2PSocketDispatcher receives and dispatches messages on the
19 // renderer thread.
18 20
19 #ifndef CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ 21 #ifndef CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_
20 #define CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ 22 #define CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_
21 23
22 #include <vector> 24 #include <vector>
23 25
24 #include "base/callback_forward.h" 26 #include "base/callback_forward.h"
25 #include "base/compiler_specific.h" 27 #include "base/compiler_specific.h"
26 #include "base/id_map.h" 28 #include "base/id_map.h"
27 #include "base/observer_list_threadsafe.h" 29 #include "base/observer_list_threadsafe.h"
(...skipping 15 matching lines...) Expand all
43 45
44 namespace webkit_glue { 46 namespace webkit_glue {
45 class NetworkListObserver; 47 class NetworkListObserver;
46 } // webkit_glue 48 } // webkit_glue
47 49
48 namespace content { 50 namespace content {
49 51
50 class P2PHostAddressRequest; 52 class P2PHostAddressRequest;
51 class P2PSocketClient; 53 class P2PSocketClient;
52 54
53 // P2PSocketDispatcher works on the renderer thread. It dispatches all
54 // messages on that thread, and all its methods must be called on the
55 // same thread.
56 class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver { 55 class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
57 public: 56 public:
58 explicit P2PSocketDispatcher(RenderViewImpl* render_view); 57 explicit P2PSocketDispatcher(RenderViewImpl* render_view);
59 virtual ~P2PSocketDispatcher(); 58 virtual ~P2PSocketDispatcher();
60 59
61 // Add a new network list observer. Each observer is called 60 // Add a new network list observer. Each observer is called
62 // immidiately after it is registered and then later whenever 61 // immidiately after it is registered and then later whenever
63 // network configuration changes. 62 // network configuration changes. Can be called on any thread. The
63 // observer is always called on the thread it was added.
64 void AddNetworkListObserver( 64 void AddNetworkListObserver(
65 webkit_glue::NetworkListObserver* network_list_observer); 65 webkit_glue::NetworkListObserver* network_list_observer);
66 66
67 // Removes network list observer. 67 // Removes network list observer. Must be called on the thread on
68 // which the observer was added.
68 void RemoveNetworkListObserver( 69 void RemoveNetworkListObserver(
69 webkit_glue::NetworkListObserver* network_list_observer); 70 webkit_glue::NetworkListObserver* network_list_observer);
70 71
71 // RenderViewObserver overrides. 72 // RenderViewObserver overrides.
72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 73 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
73 74
74 private: 75 private:
75 friend class P2PHostAddressRequest; 76 friend class P2PHostAddressRequest;
76 friend class P2PSocketClient; 77 friend class P2PSocketClient;
77 class AsyncMessageSender; 78 class AsyncMessageSender;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 network_list_observers_; 110 network_list_observers_;
110 111
111 scoped_refptr<AsyncMessageSender> async_message_sender_; 112 scoped_refptr<AsyncMessageSender> async_message_sender_;
112 113
113 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); 114 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher);
114 }; 115 };
115 116
116 } // namespace content 117 } // namespace content
117 118
118 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ 119 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698