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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 363953002: Oilpan: have the media element safely close its MediaSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tidy clearing of m_attachedElement Created 6 years, 6 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaSource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 9883ca15e071d770a2e497b891f9e0ff648b4a53..5b710d42c174b936b741b68e5aec125c0c761bfc 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -332,6 +332,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_processingPreferenceChange(false)
#if ENABLE(OILPAN)
, m_isFinalizing(false)
+ , m_closeMediaSourceWhenFinalizing(false)
#endif
, m_lastTextTrackUpdateTime(-1)
, m_audioTracks(AudioTrackList::create(*this))
@@ -390,9 +391,12 @@ HTMLMediaElement::~HTMLMediaElement()
}
#endif
+#if ENABLE(OILPAN)
+ if (m_closeMediaSourceWhenFinalizing)
+ closeMediaSource();
+#else
closeMediaSource();
-#if !ENABLE(OILPAN)
removeElementFromDocumentMap(this, &document());
#endif
@@ -443,6 +447,14 @@ HTMLMediaElement::~HTMLMediaElement()
#endif
}
+#if ENABLE(OILPAN)
+void HTMLMediaElement::setCloseMediaSourceWhenFinalizing()
+{
+ ASSERT(!m_closeMediaSourceWhenFinalizing);
+ m_closeMediaSourceWhenFinalizing = true;
+}
+#endif
+
void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument)
{
WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument");
@@ -3914,6 +3926,7 @@ void HTMLMediaElement::trace(Visitor* visitor)
visitor->trace(m_error);
visitor->trace(m_currentSourceNode);
visitor->trace(m_nextChildNodeToConsider);
+ visitor->trace(m_mediaSource);
visitor->trace(m_audioTracks);
visitor->trace(m_videoTracks);
visitor->trace(m_textTracks);
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698