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

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCDataChannel.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/RTCDataChannel.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
index e0101c9769e82c8047a95be27f8f2ad0e9bba938..b3436128d240ee773e1b44cb97d491be7122233d 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
@@ -75,13 +75,20 @@ RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<WebRTCDataC
, m_scheduledEventTimer(this, &RTCDataChannel::scheduledEventTimerFired)
, m_bufferedAmountLowThreshold(0U)
{
+ ThreadState::current()->registerPreFinalizer(this);
m_handler->setClient(this);
}
RTCDataChannel::~RTCDataChannel()
{
- // Notify the client that the channel is gone.
- m_handler->setClient(0);
+}
+
+void RTCDataChannel::dispose()
+{
+ // Promptly clears a raw reference from content/ to an on-heap object
+ // so that content/ doesn't access it in a lazy sweeping phase.
+ m_handler->setClient(nullptr);
+ m_handler.clear();
}
RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const

Powered by Google App Engine
This is Rietveld 408576698