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

Unified Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 303593002: Oilpan: prevent player from accessing its media element during finalization (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rephrase player finalization as detaching Created 6 years, 7 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: Source/web/WebMediaPlayerClientImpl.cpp
diff --git a/Source/web/WebMediaPlayerClientImpl.cpp b/Source/web/WebMediaPlayerClientImpl.cpp
index 3e58a63e22a147f0978a14fa5545b615d77dab4d..e31f3ccb9f153244274581c6eb9e5f007e842a13 100644
--- a/Source/web/WebMediaPlayerClientImpl.cpp
+++ b/Source/web/WebMediaPlayerClientImpl.cpp
@@ -73,7 +73,13 @@ WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl()
// Explicitly destroy the WebMediaPlayer to allow verification of tear down.
m_webMediaPlayer.clear();
- HTMLMediaElementEncryptedMedia::playerDestroyed(mediaElement());
+ if (m_client)
+ HTMLMediaElementEncryptedMedia::playerDestroyed(mediaElement());
+}
+
+void WebMediaPlayerClientImpl::detach()
+{
+ m_client = 0;
}
void WebMediaPlayerClientImpl::networkStateChanged()
@@ -143,7 +149,9 @@ void WebMediaPlayerClientImpl::keyNeeded(const WebString& contentType, const uns
void WebMediaPlayerClientImpl::setWebLayer(blink::WebLayer* layer)
{
- m_client->mediaPlayerSetWebLayer(layer);
+ ASSERT(m_client || !layer);
haraken 2014/05/27 23:09:09 Nit: I wonder why you need this ASSERT.
sof 2014/05/28 05:28:18 To check that the embedder only tries to clear the
+ if (m_client)
+ m_client->mediaPlayerSetWebLayer(layer);
}
void WebMediaPlayerClientImpl::addTextTrack(WebInbandTextTrack* textTrack)
« Source/core/html/HTMLMediaElement.cpp ('K') | « Source/web/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698