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

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

Issue 1876703002: Oilpan: Replace EAGERLY_FINALIZE in EventTarget's hierarchy with pre-finalizers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index b77dd2f8ae5540744ef64cc33e49bd450fbe26e6..fb27f37c08ec73bb64d9192d29da2b3b84fbd841 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -413,6 +413,7 @@ RTCPeerConnection::RTCPeerConnection(ExecutionContext* context, RTCConfiguration
, m_stopped(false)
, m_closed(false)
{
+ ThreadState::current()->registerPreFinalizer(this);
Document* document = toDocument(getExecutionContext());
// If we fail, set |m_closed| and |m_stopped| to true, to avoid hitting the assert in the destructor.
@@ -449,6 +450,11 @@ RTCPeerConnection::~RTCPeerConnection()
DCHECK(m_closed || m_stopped);
}
+void RTCPeerConnection::dispose()
+{
+ m_peerHandler.clear();
+}
+
ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTCOfferOptions& options)
{
if (m_signalingState == SignalingStateClosed)

Powered by Google App Engine
This is Rietveld 408576698