Avoid trigger compositing update on media player finalization.

When finalizing a media element and clearing out its associated
media player, prevent the media player finalizer from indirectly
triggering a composition update on the media element itself.
Unsafe, as it will touch other heap objects, which might have
been finalized by now.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/696103003

git-svn-id: svn://svn.chromium.org/blink/trunk@184769 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 3ffd916..7e37c49b 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3947,15 +3947,18 @@
         return;
 
     // If either of the layers is null we need to enable or disable compositing. This is done by triggering a style recalc.
-    if (!m_webLayer || !webLayer)
+    if ((!m_webLayer || !webLayer)
+#if ENABLE(OILPAN)
+        && !isFinalizing()
+#endif
+        )
         setNeedsCompositingUpdate();
 
     if (m_webLayer)
         GraphicsLayer::unregisterContentsLayer(m_webLayer);
     m_webLayer = webLayer;
-    if (m_webLayer) {
+    if (m_webLayer)
         GraphicsLayer::registerContentsLayer(m_webLayer);
-    }
 }
 
 void HTMLMediaElement::mediaPlayerMediaSourceOpened(blink::WebMediaSource* webMediaSource)