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

Unified Diff: Source/core/html/HTMLMediaElement.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: Switch back to initial approach + FIXMEs for follow-up work 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/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 42f201be24c22d76ea68cd36081d7fbe823fab14..91f87f6d7aef089312dd1dd65cbea2124e420c4d 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -282,6 +282,9 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_tracksAreReady(true)
, m_haveVisibleTextTrack(false)
, m_processingPreferenceChange(false)
+#if ENABLE(OILPAN)
+ , m_isFinalizing(false)
+#endif
, m_lastTextTrackUpdateTime(-1)
, m_textTracks(nullptr)
, m_ignoreTrackDisplayUpdate(0)
@@ -363,6 +366,20 @@ HTMLMediaElement::~HTMLMediaElement()
document().incrementLoadEventDelayCount();
#endif
+#if ENABLE(OILPAN)
+ // Oilpan: the player must be released, but the player object
+ // cannot safely access this player client any longer as parts of
+ // it may have been finalized already (like the media element's
+ // supplementable table.) Handled for now by entering an
+ // is-finalizing state, which is explicitly checked for if the
+ // player tries to access the media element during shutdown.
+ //
+ // FIXME: Oilpan: move the media player to the heap instead and
+ // avoid having to finalize it from here; this whole #if block
+ // could then be removed (along with the state bit it depends on.)
+ // crbug.com/378229
+ m_isFinalizing = true;
+#endif
clearMediaPlayerAndAudioSourceProviderClient();
#if !ENABLE(OILPAN)
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698