| Index: content/renderer/p2p/socket_dispatcher.h
|
| diff --git a/content/renderer/p2p/socket_dispatcher.h b/content/renderer/p2p/socket_dispatcher.h
|
| index b4936ea7e8cc88bb78701b0d3ded55692e3e9870..027ef81202e6e91d2f3a8ad8716fb65fa0f70d3e 100644
|
| --- a/content/renderer/p2p/socket_dispatcher.h
|
| +++ b/content/renderer/p2p/socket_dispatcher.h
|
| @@ -30,7 +30,7 @@
|
| #include "base/synchronization/lock.h"
|
| #include "content/common/content_export.h"
|
| #include "content/common/p2p_sockets.h"
|
| -#include "content/public/renderer/render_view_observer.h"
|
| +#include "ipc/ipc_channel_proxy.h"
|
| #include "net/base/net_util.h"
|
|
|
| class RenderViewImpl;
|
| @@ -64,10 +64,10 @@ class P2PSocketDispatcherDestructionObserver {
|
| virtual ~P2PSocketDispatcherDestructionObserver() {}
|
| };
|
|
|
| -class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
|
| +class CONTENT_EXPORT P2PSocketDispatcher
|
| + : public IPC::ChannelProxy::MessageFilter{
|
| public:
|
| - explicit P2PSocketDispatcher(RenderViewImpl* render_view);
|
| - virtual ~P2PSocketDispatcher();
|
| + P2PSocketDispatcher(base::MessageLoopProxy* ipc_message_loop);
|
|
|
| // Add a new network list observer. Each observer is called
|
| // immidiately after it is registered and then later whenever
|
| @@ -85,14 +85,24 @@ class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
|
| void RemoveDestructionObserver(
|
| P2PSocketDispatcherDestructionObserver* observer);
|
|
|
| - // RenderViewObserver overrides.
|
| - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| + protected:
|
| + virtual ~P2PSocketDispatcher();
|
|
|
| private:
|
| friend class P2PHostAddressRequest;
|
| friend class P2PSocketClient;
|
| class AsyncMessageSender;
|
|
|
| + // Send a message asynchronously. Must be called on the IO thread.
|
| + virtual void Send(IPC::Message* message);
|
| +
|
| + // IPC::ChannelProxy::MessageFilter override. Called on IO thread.
|
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| + virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
|
| + virtual void OnFilterRemoved() OVERRIDE;
|
| + virtual void OnChannelClosing() OVERRIDE;
|
| +
|
| + // Returns the IO message loop.
|
| base::MessageLoopProxy* message_loop();
|
|
|
| // Called by P2PSocketClient.
|
| @@ -129,6 +139,8 @@ class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
|
|
|
| ObserverList<P2PSocketDispatcherDestructionObserver> destruction_observer_;
|
|
|
| + IPC::Channel* channel_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher);
|
| };
|
|
|
|
|