| 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
|
|
|