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

Unified Diff: Source/modules/mediastream/RTCPeerConnection.cpp

Issue 342683002: Oilpan: Use weak processing to stop a closed RTCPeerConnection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/modules/mediastream/RTCPeerConnection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
index 9fa043f41ad084136ab707cbb02866952bb0f86f..eefcc587293f561d1a0b93f752355af056aa9b55 100644
--- a/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -220,10 +220,9 @@ RTCPeerConnection::~RTCPeerConnection()
// We are assuming that a wrapper is always created when RTCPeerConnection is created.
ASSERT(m_closed || m_stopped);
- // FIXME: Oilpan: We can't call stop here since it touches m_dataChannels.
- // Another way to ensure that data channels are stopped at RTCPeerConnection
- // destruction is needed.
+#if !ENABLE(OILPAN)
stop();
+#endif
}
void RTCPeerConnection::createOffer(PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
@@ -742,12 +741,19 @@ void RTCPeerConnection::dispatchScheduledEvent()
events.clear();
}
+void RTCPeerConnection::clearWeakMembers(Visitor* visitor)
+{
+ if (!visitor->isAlive(this) && m_closed)
Mads Ager (chromium) 2014/06/18 08:19:50 This will not work because weak processing only ha
keishi 2014/06/18 08:56:58 Done.
+ stop();
+}
+
void RTCPeerConnection::trace(Visitor* visitor)
{
visitor->trace(m_localStreams);
visitor->trace(m_remoteStreams);
visitor->trace(m_dataChannels);
visitor->trace(m_scheduledEvents);
+ visitor->registerWeakMembers<RTCPeerConnection, &RTCPeerConnection::clearWeakMembers>(this);
EventTargetWithInlineData::trace(visitor);
}
« no previous file with comments | « Source/modules/mediastream/RTCPeerConnection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698