Add more Fullscreen logging
[WebKit-https.git] / Source / WebKit / WebProcess / FullScreen / WebFullScreenManager.cpp
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());
 }