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

Unified Diff: content/renderer/p2p/socket_dispatcher.h

Issue 10387135: Add deletion observer to P2PSocketDispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dll export. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | content/renderer/p2p/socket_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/socket_dispatcher.h
diff --git a/content/renderer/p2p/socket_dispatcher.h b/content/renderer/p2p/socket_dispatcher.h
index 8cebd5190f221f9eb26568fb7e6ac149482da7f3..b4936ea7e8cc88bb78701b0d3ded55692e3e9870 100644
--- a/content/renderer/p2p/socket_dispatcher.h
+++ b/content/renderer/p2p/socket_dispatcher.h
@@ -52,6 +52,18 @@ namespace content {
class P2PHostAddressRequest;
class P2PSocketClient;
+// Callback interface that allows the implementor to be notified before a
+// P2PSocketDispatcher is destroyed.
+// P2PSocketDispatcher requires that all NetworkListObservers are
+// unregistered when SocketDispatcherGone is called.
+class P2PSocketDispatcherDestructionObserver {
+ public:
+ virtual void OnSocketDispatcherDestroyed() = 0;
+
+ protected:
+ virtual ~P2PSocketDispatcherDestructionObserver() {}
+};
+
class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
public:
explicit P2PSocketDispatcher(RenderViewImpl* render_view);
@@ -69,6 +81,10 @@ class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
void RemoveNetworkListObserver(
webkit_glue::NetworkListObserver* network_list_observer);
+ void AddDestructionObserver(P2PSocketDispatcherDestructionObserver* observer);
+ void RemoveDestructionObserver(
+ P2PSocketDispatcherDestructionObserver* observer);
+
// RenderViewObserver overrides.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -111,6 +127,8 @@ class CONTENT_EXPORT P2PSocketDispatcher : public content::RenderViewObserver {
scoped_refptr<AsyncMessageSender> async_message_sender_;
+ ObserverList<P2PSocketDispatcherDestructionObserver> destruction_observer_;
+
DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher);
};
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | content/renderer/p2p/socket_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698