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

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

Issue 536133003: MergeNetworkList can't group address under the same interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable a unit test until webrtc fix is merged into chrome Created 6 years, 3 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
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.
(...skipping 30 matching lines...) Expand all
41 class IPEndPoint; 41 class IPEndPoint;
42 } // namespace net 42 } // namespace net
43 43
44 namespace content { 44 namespace content {
45 45
46 class NetworkListObserver; 46 class NetworkListObserver;
47 class P2PAsyncAddressResolver; 47 class P2PAsyncAddressResolver;
48 class P2PSocketClientImpl; 48 class P2PSocketClientImpl;
49 class RenderViewImpl; 49 class RenderViewImpl;
50 50
51 class CONTENT_EXPORT P2PSocketDispatcher : public IPC::MessageFilter { 51 class P2PSocketDispatcherInterface {
Sergey Ulanov 2014/09/10 18:05:32 We don't normally use Interface suffix for interfa
guoweis_webrtc 2014/09/10 19:56:33 Since it's the manager of NetworkListObserver, I n
Sergey Ulanov 2014/09/10 22:28:25 This doesn't look like a good name. It doesn't man
guoweis_webrtc 2014/09/10 23:22:25 Changed to NetworkListManager
52 public:
53 // Add a new network list observer.
54 virtual void AddNetworkListObserver(
55 NetworkListObserver* network_list_observer) = 0;
56
57 // Removes network list observer.
58 virtual void RemoveNetworkListObserver(
59 NetworkListObserver* network_list_observer) = 0;
60
61 protected:
62 // Marked as protected to prevent explicit deletion, as
63 // P2PSocketDispatcher is not owned by IpcNetworkManager.
64 virtual ~P2PSocketDispatcherInterface() {}
65 };
66
67 class CONTENT_EXPORT P2PSocketDispatcher
68 : public IPC::MessageFilter, public P2PSocketDispatcherInterface {
Sergey Ulanov 2014/09/10 18:05:32 indentation.
guoweis_webrtc 2014/09/10 19:56:33 Done.
52 public: 69 public:
53 explicit P2PSocketDispatcher(base::MessageLoopProxy* ipc_message_loop); 70 explicit P2PSocketDispatcher(base::MessageLoopProxy* ipc_message_loop);
54 71
55 // Add a new network list observer. Each observer is called 72 // Each observer is called immidiately after it is registered and
Sergey Ulanov 2014/09/10 18:05:32 This comment should be in the interface definition
guoweis_webrtc 2014/09/10 19:56:33 I feel how it should be called is really an implem
Sergey Ulanov 2014/09/10 22:28:25 These are not implementation details - they are pa
guoweis_webrtc 2014/09/10 23:22:25 Done.
56 // immidiately after it is registered and then later whenever 73 // then later whenever network configuration changes. Can be called
57 // network configuration changes. Can be called on any thread. The 74 // on any thread. The observer is always called on the thread it was
58 // observer is always called on the thread it was added. 75 // added.
59 void AddNetworkListObserver(NetworkListObserver* network_list_observer); 76 virtual void AddNetworkListObserver(
77 NetworkListObserver* network_list_observer) OVERRIDE;
60 78
61 // Removes network list observer. Must be called on the thread on 79 // Must be called on the thread on which the observer was added.
62 // which the observer was added. 80 virtual void RemoveNetworkListObserver(
63 void RemoveNetworkListObserver(NetworkListObserver* network_list_observer); 81 NetworkListObserver* network_list_observer) OVERRIDE;
64 82
65 protected: 83 protected:
66 virtual ~P2PSocketDispatcher(); 84 virtual ~P2PSocketDispatcher();
67 85
68 private: 86 private:
69 friend class P2PAsyncAddressResolver; 87 friend class P2PAsyncAddressResolver;
70 friend class P2PSocketClientImpl; 88 friend class P2PSocketClientImpl;
71 89
72 // Send a message asynchronously. 90 // Send a message asynchronously.
73 virtual void Send(IPC::Message* message); 91 virtual void Send(IPC::Message* message);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 network_list_observers_; 134 network_list_observers_;
117 135
118 IPC::Sender* sender_; 136 IPC::Sender* sender_;
119 137
120 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); 138 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher);
121 }; 139 };
122 140
123 } // namespace content 141 } // namespace content
124 142
125 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ 143 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698