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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.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/encryptedmedia/MediaKeySession.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
index 55cd354377b24372d7ce1b3f91be4664b868dafe..5f442c91afb392fc64ce67d0ec57851cd96b6f23 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -322,6 +322,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
, m_actionTimer(this, &MediaKeySession::actionTimerFired)
{
WTF_LOG(Media, "MediaKeySession(%p)::MediaKeySession", this);
+ ThreadState::current()->registerPreFinalizer(this);
// Create the matching Chromium object. It will not be usable until
// initializeNewSession() is called in response to the user calling
@@ -364,13 +365,13 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys,
MediaKeySession::~MediaKeySession()
{
WTF_LOG(Media, "MediaKeySession(%p)::~MediaKeySession", this);
+}
+
+void MediaKeySession::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_session.clear();
-#if !ENABLE(OILPAN)
- // MediaKeySession and m_asyncEventQueue always become unreachable
- // together. So MediaKeySession and m_asyncEventQueue are destructed in the
- // same GC. We don't need to call cancelAllEvents explicitly in Oilpan.
- m_asyncEventQueue->cancelAllEvents();
-#endif
}
String MediaKeySession::sessionId() const

Powered by Google App Engine
This is Rietveld 408576698