Add more Fullscreen logging
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 22:05:45 +0000 (22:05 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 22:05:45 +0000 (22:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189656

Reviewed by Jer Noble.

Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
the fullscreen element.

Source/WebCore:

* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):

Source/WebKit:

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::WebFullScreenManager):
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):
(WebKit::WebFullScreenManager::setPIPStandbyElement):
(WebKit::WebFullScreenManager::enterFullScreenForElement):
(WebKit::WebFullScreenManager::exitFullScreenForElement):
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
(WebKit::WebFullScreenManager::didExitFullScreen):
(WebKit::WebFullScreenManager::close):
* WebProcess/FullScreen/WebFullScreenManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236088 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h

index 0b68261..5549b4b 100644 (file)
@@ -1,3 +1,18 @@
+2018-09-17  Simon Fraser  <simon.fraser@apple.com>
+
+        Add more Fullscreen logging
+        https://bugs.webkit.org/show_bug.cgi?id=189656
+
+        Reviewed by Jer Noble.
+
+        Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
+        the fullscreen element.
+
+        * platform/cocoa/VideoFullscreenModelVideoElement.mm:
+        (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
+        (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
+        (VideoFullscreenModelVideoElement::setVideoElement):
+
 2018-09-14  Simon Fraser  <simon.fraser@apple.com>
 
         Add support for dumping the GraphicsLayer tree via notifyutil
index c0a4fa5..ff39282 100644 (file)
@@ -50,10 +50,12 @@ using namespace WebCore;
 VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement()
     : EventListener(EventListener::CPPEventListenerType)
 {
+    LOG(Fullscreen, "VideoFullscreenModelVideoElement %p ctor", this);
 }
 
 VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement()
 {
+    LOG(Fullscreen, "VideoFullscreenModelVideoElement %p dtor", this);
 }
 
 void VideoFullscreenModelVideoElement::setVideoElement(HTMLVideoElement* videoElement)
@@ -61,6 +63,8 @@ void VideoFullscreenModelVideoElement::setVideoElement(HTMLVideoElement* videoEl
     if (m_videoElement == videoElement)
         return;
 
+    LOG(Fullscreen, "VideoFullscreenModelVideoElement %p setVideoElement(%p)", this, videoElement);
+
     if (m_videoElement && m_videoElement->videoFullscreenLayer())
         m_videoElement->setVideoFullscreenLayer(nullptr);
 
index 1b0e8ad..83e1843 100644 (file)
@@ -1,3 +1,26 @@
+2018-09-17  Simon Fraser  <simon.fraser@apple.com>
+
+        Add more Fullscreen logging
+        https://bugs.webkit.org/show_bug.cgi?id=189656
+
+        Reviewed by Jer Noble.
+
+        Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
+        the fullscreen element.
+
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::WebFullScreenManager::WebFullScreenManager):
+        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
+        (WebKit::WebFullScreenManager::setPIPStandbyElement):
+        (WebKit::WebFullScreenManager::enterFullScreenForElement):
+        (WebKit::WebFullScreenManager::exitFullScreenForElement):
+        (WebKit::WebFullScreenManager::willEnterFullScreen):
+        (WebKit::WebFullScreenManager::didEnterFullScreen):
+        (WebKit::WebFullScreenManager::willExitFullScreen):
+        (WebKit::WebFullScreenManager::didExitFullScreen):
+        (WebKit::WebFullScreenManager::close):
+        * WebProcess/FullScreen/WebFullScreenManager.h:
+
 2018-09-17  Tim Horton  <timothy_horton@apple.com>
 
         Swipe snapshot can get stuck if swiping is disabled while it is visible
index 4cadc05..78d881e 100644 (file)
@@ -28,6 +28,7 @@
 #if ENABLE(FULLSCREEN_API)
 
 #include "Connection.h"
+#include "Logging.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebFullScreenManagerProxyMessages.h"
@@ -70,8 +71,7 @@ Ref<WebFullScreenManager> WebFullScreenManager::create(WebPage* page)
 }
 
 WebFullScreenManager::WebFullScreenManager(WebPage* page)
-    : m_topContentInset(0)
-    , m_page(page)
+    : m_page(page)
 {
 }
     
@@ -87,6 +87,8 @@ WebCore::Element* WebFullScreenManager::element()
 void WebFullScreenManager::videoControlsManagerDidChange()
 {
 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+    LOG(Fullscreen, "WebFullScreenManager %p videoControlsManagerDidChange()", this);
+
     auto* currentPlaybackControlsElement = m_page->playbackSessionManager().currentPlaybackControlsElement();
     if (!m_element || !is<HTMLVideoElement>(currentPlaybackControlsElement)) {
         setPIPStandbyElement(nullptr);
@@ -103,6 +105,8 @@ void WebFullScreenManager::setPIPStandbyElement(WebCore::HTMLVideoElement* pipSt
     if (pipStandbyElement == m_pipStandbyElement)
         return;
 
+    LOG(Fullscreen, "WebFullScreenManager %p setPIPStandbyElement() - old element %p, new element %p", this, m_pipStandbyElement.get(), pipStandbyElement);
+
     if (m_pipStandbyElement)
         m_pipStandbyElement->setVideoFullscreenStandby(false);
 
@@ -128,6 +132,8 @@ bool WebFullScreenManager::supportsFullScreen(bool withKeyboard)
 
 void WebFullScreenManager::enterFullScreenForElement(WebCore::Element* element)
 {
+    LOG(Fullscreen, "WebFullScreenManager %p enterFullScreenForElement(%p)", this, element);
+
     ASSERT(element);
     m_element = element;
     m_initialFrame = screenRectOfContents(m_element.get());
@@ -136,12 +142,14 @@ void WebFullScreenManager::enterFullScreenForElement(WebCore::Element* element)
 
 void WebFullScreenManager::exitFullScreenForElement(WebCore::Element* element)
 {
+    LOG(Fullscreen, "WebFullScreenManager %p exitFullScreenForElement(%p) - fullscreen element %p", this, element, m_element.get());
     m_page->injectedBundleFullScreenClient().exitFullScreenForElement(m_page.get(), element);
 }
 
 void WebFullScreenManager::willEnterFullScreen()
 {
-    ASSERT(m_element);
+    LOG(Fullscreen, "WebFullScreenManager %p willEnterFullScreen() - element %p", this, m_element.get());
+
     m_element->document().webkitWillEnterFullScreenForElement(m_element.get());
 #if !PLATFORM(IOS)
     m_page->hidePageBanners();
@@ -154,7 +162,8 @@ void WebFullScreenManager::willEnterFullScreen()
 
 void WebFullScreenManager::didEnterFullScreen()
 {
-    ASSERT(m_element);
+    LOG(Fullscreen, "WebFullScreenManager %p didEnterFullScreen() - element %p", this, m_element.get());
+
     m_element->document().webkitDidEnterFullScreenForElement(m_element.get());
 
 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
@@ -165,6 +174,7 @@ void WebFullScreenManager::didEnterFullScreen()
 
 void WebFullScreenManager::willExitFullScreen()
 {
+    LOG(Fullscreen, "WebFullScreenManager %p willExitFullScreen() - element %p", this, m_element.get());
     ASSERT(m_element);
 
 #if ENABLE(VIDEO)
@@ -181,6 +191,8 @@ void WebFullScreenManager::willExitFullScreen()
 
 void WebFullScreenManager::didExitFullScreen()
 {
+    LOG(Fullscreen, "WebFullScreenManager %p didExitFullScreen() - element %p", this, m_element.get());
+
     ASSERT(m_element);
     setFullscreenInsets(FloatBoxExtent());
     setFullscreenAutoHideDuration(0_s);
@@ -201,6 +213,7 @@ void WebFullScreenManager::requestExitFullScreen()
 
 void WebFullScreenManager::close()
 {
+    LOG(Fullscreen, "WebFullScreenManager %p close()", this);
     m_page->injectedBundleFullScreenClient().closeFullScreen(m_page.get());
 }
 
index 3c8ad02..9120ac9 100644 (file)
@@ -22,8 +22,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef WebFullScreenManager_h
-#define WebFullScreenManager_h
+
+#pragma once
 
 #if ENABLE(FULLSCREEN_API)
 
@@ -89,7 +89,7 @@ protected:
     WebCore::IntRect m_initialFrame;
     WebCore::IntRect m_finalFrame;
     WebCore::IntPoint m_scrollPosition;
-    float m_topContentInset;
+    float m_topContentInset { 0 };
     RefPtr<WebPage> m_page;
     RefPtr<WebCore::Element> m_element;
 #if ENABLE(VIDEO)
@@ -100,5 +100,3 @@ protected:
 } // namespace WebKit
 
 #endif // ENABLE(FULLSCREEN_API)
-
-#endif // WebFullScreenManager_h