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

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

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/p2p/socket_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/socket_dispatcher.cc
diff --git a/content/renderer/p2p/socket_dispatcher.cc b/content/renderer/p2p/socket_dispatcher.cc
index 4317725b7af9e753fde2dabca79db4daa7acdbc0..1b46dcb6de924d7a2658a4e8ab052a3d1a143ee9 100644
--- a/content/renderer/p2p/socket_dispatcher.cc
+++ b/content/renderer/p2p/socket_dispatcher.cc
@@ -59,6 +59,8 @@ P2PSocketDispatcher::P2PSocketDispatcher(RenderViewImpl* render_view)
}
P2PSocketDispatcher::~P2PSocketDispatcher() {
+ FOR_EACH_OBSERVER(P2PSocketDispatcherDestructionObserver,
+ destruction_observer_, OnSocketDispatcherDestroyed());
network_list_observers_->AssertEmpty();
if (network_notifications_started_)
Send(new P2PHostMsg_StopNetworkNotifications(routing_id()));
@@ -82,6 +84,16 @@ void P2PSocketDispatcher::RemoveNetworkListObserver(
network_list_observers_->RemoveObserver(network_list_observer);
}
+void P2PSocketDispatcher::AddDestructionObserver(
+ P2PSocketDispatcherDestructionObserver* observer) {
+ destruction_observer_.AddObserver(observer);
+}
+
+void P2PSocketDispatcher::RemoveDestructionObserver(
+ P2PSocketDispatcherDestructionObserver* observer) {
+ destruction_observer_.RemoveObserver(observer);
+}
+
bool P2PSocketDispatcher::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(P2PSocketDispatcher, message)
« no previous file with comments | « content/renderer/p2p/socket_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698