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