OSDN Git Service

Fix the null pointer crash when playing full screen video.
authorTeng-Hui Zhu <ztenghui@google.com>
Mon, 29 Aug 2011 22:11:12 +0000 (15:11 -0700)
committerTeng-Hui Zhu <ztenghui@google.com>
Mon, 29 Aug 2011 22:15:57 +0000 (15:15 -0700)
bug:5220693
Change-Id: I3696a8523c3328363ec9d162ef32525c7fbab930

Source/WebCore/html/shadow/MediaControlRootElement.cpp
Source/WebCore/page/FrameView.cpp

index e063c4c..434e062 100644 (file)
@@ -412,8 +412,10 @@ void MediaControlRootElement::changedVolume()
 void MediaControlRootElement::enteredFullscreen()
 {
     if (m_mediaElement->movieLoadType() == MediaPlayer::LiveStream || m_mediaElement->movieLoadType() == MediaPlayer::StoredStream) {
+#if !PLATFORM(ANDROID)
         m_seekBackButton->hide();
         m_seekForwardButton->hide();
+#endif
     } else
         m_rewindButton->hide();
 }
@@ -424,8 +426,10 @@ void MediaControlRootElement::exitedFullscreen()
     // when exiting fullscreen.
     // FIXME: Clarify naming of show/hide <http://webkit.org/b/58157>
     m_rewindButton->show();
+#if !PLATFORM(ANDROID)
     m_seekBackButton->show();
     m_seekForwardButton->show();
+#endif
 }
 
 void MediaControlRootElement::showVolumeSlider()
index ee6bd6b..49a7d0c 100644 (file)
@@ -652,6 +652,12 @@ bool FrameView::syncCompositingStateForThisFrame()
     // the fullScreenRenderer's graphicsLayer here:
     Document* document = m_frame->document();
     if (isDocumentRunningFullScreenAnimation(document)) {
+#if PLATFORM(ANDROID)
+        // We don't create an extra layer for the full screen video.
+        if (!document->fullScreenRenderer()->layer()
+            || !document->fullScreenRenderer()->layer()->backing())
+            return true;
+#endif
         RenderLayerBacking* backing = document->fullScreenRenderer()->layer()->backing();
         if (GraphicsLayer* fullScreenLayer = backing->graphicsLayer())
             fullScreenLayer->syncCompositingState();