Title: [110708] trunk
Revision
110708
Author
jer.no...@apple.com
Date
2012-03-14 09:21:05 -0700 (Wed, 14 Mar 2012)

Log Message

Lion Intel Debug WebKit2 Tests crashing under [WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]
https://bugs.webkit.org/show_bug.cgi?id=81056

Reviewed by Jessie Berlin.

Source/WebKit2:

Give the InjectedBundlePageFullScreenClient a first crack at beganEnterFullScreen and beganExitFullScreen:
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):

And call the client function if it exists; otherwise, continue to message the page:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp:
(WebKit::InjectedBundlePageFullScreenClient::beganEnterFullScreen):
(WebKit::InjectedBundlePageFullScreenClient::beganExitFullScreen):
* WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h:

Add a custom APIClientTraits for InjectedBundlePageFullScreenClient to handle the API number change.
* Shared/APIClientTraits.cpp:
* Shared/APIClientTraits.h:

Tools:

Intercept beganEnterFullScreen and beganExitFullScreen and turn them into no-ops (plus logging).

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::beganEnterFullScreen):
(WTR::InjectedBundlePage::beganExitFullScreen):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (110707 => 110708)


--- trunk/Source/WebKit2/ChangeLog	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-14 16:21:05 UTC (rev 110708)
@@ -1,3 +1,26 @@
+2012-03-13  Jer Noble  <jer.no...@apple.com>
+
+        Lion Intel Debug WebKit2 Tests crashing under [WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]
+        https://bugs.webkit.org/show_bug.cgi?id=81056
+
+        Reviewed by Jessie Berlin.
+
+        Give the InjectedBundlePageFullScreenClient a first crack at beganEnterFullScreen and beganExitFullScreen:
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::WebFullScreenManager::willEnterFullScreen):
+        (WebKit::WebFullScreenManager::willExitFullScreen):
+
+        And call the client function if it exists; otherwise, continue to message the page:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp:
+        (WebKit::InjectedBundlePageFullScreenClient::beganEnterFullScreen):
+        (WebKit::InjectedBundlePageFullScreenClient::beganExitFullScreen):
+        * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h:
+
+        Add a custom APIClientTraits for InjectedBundlePageFullScreenClient to handle the API number change.
+        * Shared/APIClientTraits.cpp:
+        * Shared/APIClientTraits.h:
+
 2012-03-14  Andrey Kosyakov  <ca...@chromium.org>
 
         Web Inspector: add didCancelFrame timeline event

Modified: trunk/Source/WebKit2/Shared/APIClientTraits.cpp (110707 => 110708)


--- trunk/Source/WebKit2/Shared/APIClientTraits.cpp	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/Shared/APIClientTraits.cpp	2012-03-14 16:21:05 UTC (rev 110708)
@@ -39,6 +39,11 @@
     offsetof(WKBundlePageResourceLoadClient, shouldCacheResponse),
     sizeof(WKBundlePageResourceLoadClient)
 };
+
+const size_t APIClientTraits<WKBundlePageFullScreenClient>::interfaceSizesByVersion[] = {
+    offsetof(WKBundlePageFullScreenClient, beganEnterFullScreen),
+    sizeof(WKBundlePageFullScreenClient)
+};
     
 const size_t APIClientTraits<WKPageContextMenuClient>::interfaceSizesByVersion[] = {
     offsetof(WKPageContextMenuClient, contextMenuDismissed),

Modified: trunk/Source/WebKit2/Shared/APIClientTraits.h (110707 => 110708)


--- trunk/Source/WebKit2/Shared/APIClientTraits.h	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/Shared/APIClientTraits.h	2012-03-14 16:21:05 UTC (rev 110708)
@@ -44,6 +44,10 @@
     static const size_t interfaceSizesByVersion[2];
 };
 
+template<> struct APIClientTraits<WKBundlePageFullScreenClient> {
+    static const size_t interfaceSizesByVersion[2];
+};
+
 template<> struct APIClientTraits<WKPageContextMenuClient> {
     static const size_t interfaceSizesByVersion[3];
 };

Modified: trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp (110707 => 110708)


--- trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp	2012-03-14 16:21:05 UTC (rev 110708)
@@ -113,7 +113,7 @@
     m_element->document()->updateLayout();
     m_page->forceRepaintWithoutCallback();
     m_finalFrame = screenRectOfContents(m_element.get());
-    m_page->send(Messages::WebFullScreenManagerProxy::BeganEnterFullScreen(m_initialFrame, m_finalFrame));
+    m_page->injectedBundleFullScreenClient().beganEnterFullScreen(m_page.get(), m_initialFrame, m_finalFrame);
 }
 
 void WebFullScreenManager::didEnterFullScreen()
@@ -127,7 +127,7 @@
     ASSERT(m_element);
     m_finalFrame = screenRectOfContents(m_element.get());
     m_element->document()->webkitWillExitFullScreenForElement(m_element.get());
-    m_page->send(Messages::WebFullScreenManagerProxy::BeganExitFullScreen(m_finalFrame, m_initialFrame));
+    m_page->injectedBundleFullScreenClient().beganExitFullScreen(m_page.get(), m_finalFrame, m_initialFrame);
 }
 
 void WebFullScreenManager::didExitFullScreen()

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (110707 => 110708)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2012-03-14 16:21:05 UTC (rev 110708)
@@ -303,17 +303,25 @@
 typedef bool (*WKBundlePageSupportsFullScreen)(WKBundlePageRef page, WKFullScreenKeyboardRequestType requestType);
 typedef void (*WKBundlePageEnterFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
 typedef void (*WKBundlePageExitFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
+typedef void (*WKBundlePageBeganEnterFullScreen)(WKBundlePageRef page, WKRect initialFrame, WKRect finalFrame);
+typedef void (*WKBundlePageBeganExitFullScreen)(WKBundlePageRef page, WKRect initialFrame, WKRect finalFrame);
 
 struct WKBundlePageFullScreenClient {
     int                                                                 version;
     const void *                                                        clientInfo;
+
+    // Version 0:
     WKBundlePageSupportsFullScreen                                      supportsFullScreen;
     WKBundlePageEnterFullScreenForElement                               enterFullScreenForElement;
     WKBundlePageExitFullScreenForElement                                exitFullScreenForElement;
+
+    // Version 1:
+    WKBundlePageBeganEnterFullScreen                                    beganEnterFullScreen;
+    WKBundlePageBeganExitFullScreen                                     beganExitFullScreen;
 };
 typedef struct WKBundlePageFullScreenClient WKBundlePageFullScreenClient;
 
-enum { kWKBundlePageFullScreenClientCurrentVersion = 0 };
+enum { kWKBundlePageFullScreenClientCurrentVersion = 1 };
 
 WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page);

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp (110707 => 110708)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp	2012-03-14 16:21:05 UTC (rev 110708)
@@ -32,6 +32,8 @@
 #include "InjectedBundleNodeHandle.h"
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
+#include "WKSharedAPICast.h"
+#include "WebCoreArgumentCoders.h"
 #include "WebFullScreenManagerProxyMessages.h"
 #include "WebPage.h"
 #include <WebCore/Element.h>
@@ -68,6 +70,24 @@
         page->send(Messages::WebFullScreenManagerProxy::ExitFullScreen());
 }
 
+
+void InjectedBundlePageFullScreenClient::beganEnterFullScreen(WebPage *page, IntRect& initialFrame, IntRect& finalFrame)
+{
+    if (m_client.beganEnterFullScreen)
+        m_client.beganEnterFullScreen(toAPI(page), toAPI(initialFrame), toAPI(finalFrame));
+    else
+        page->send(Messages::WebFullScreenManagerProxy::BeganEnterFullScreen(initialFrame, finalFrame));
+}
+
+
+void InjectedBundlePageFullScreenClient::beganExitFullScreen(WebPage *page, IntRect& initialFrame, IntRect& finalFrame)
+{
+    if (m_client.beganExitFullScreen)
+        m_client.beganExitFullScreen(toAPI(page), toAPI(initialFrame), toAPI(finalFrame));
+    else
+        page->send(Messages::WebFullScreenManagerProxy::BeganExitFullScreen(initialFrame, finalFrame));
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(FULLSCREEN_API)

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h (110707 => 110708)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h	2012-03-14 16:21:05 UTC (rev 110708)
@@ -35,6 +35,7 @@
 
 namespace WebCore {
 class Element;
+class IntRect;
 }
 
 namespace WebKit {
@@ -46,6 +47,8 @@
     bool supportsFullScreen(WebPage*, bool withKeyboard);
     void enterFullScreenForElement(WebPage*, WebCore::Element*);
     void exitFullScreenForElement(WebPage*, WebCore::Element*);
+    void beganEnterFullScreen(WebPage*, WebCore::IntRect& initialFrame, WebCore::IntRect& finalFrame);
+    void beganExitFullScreen(WebPage*, WebCore::IntRect& initialFrame, WebCore::IntRect& finalFrame);
 };
 
 } // namespace WebKit

Modified: trunk/Tools/ChangeLog (110707 => 110708)


--- trunk/Tools/ChangeLog	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Tools/ChangeLog	2012-03-14 16:21:05 UTC (rev 110708)
@@ -1,3 +1,17 @@
+2012-03-13  Jer Noble  <jer.no...@apple.com>
+
+        Lion Intel Debug WebKit2 Tests crashing under [WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]
+        https://bugs.webkit.org/show_bug.cgi?id=81056
+
+        Reviewed by Jessie Berlin.
+
+        Intercept beganEnterFullScreen and beganExitFullScreen and turn them into no-ops (plus logging).
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage):
+        (WTR::InjectedBundlePage::beganEnterFullScreen):
+        (WTR::InjectedBundlePage::beganExitFullScreen):
+
 2012-03-14  Alexander Færøy  <alexander.fae...@nokia.com>
 
         The width and height of the scroll indicators in the MiniBrowser does

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (110707 => 110708)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-03-14 16:21:05 UTC (rev 110708)
@@ -288,6 +288,8 @@
         supportsFullScreen,
         enterFullScreenForElement,
         exitFullScreenForElement,
+        beganEnterFullScreen,
+        beganExitFullScreen,
     };
     WKBundlePageSetFullScreenClient(m_page, &fullScreenClient);
 #endif
@@ -1112,6 +1114,18 @@
     WKBundlePageWillExitFullScreen(pageRef);
     WKBundlePageDidExitFullScreen(pageRef);
 }
+
+void InjectedBundlePage::beganEnterFullScreen(WKBundlePageRef, WKRect, WKRect)
+{
+    if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+        InjectedBundle::shared().os() << "beganEnterFullScreen()\n";
+}
+
+void InjectedBundlePage::beganExitFullScreen(WKBundlePageRef, WKRect, WKRect)
+{
+    if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
+        InjectedBundle::shared().os() << "beganExitFullScreen()\n";
+}
 #endif
 
 static bool compareByTargetName(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h (110707 => 110708)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h	2012-03-14 16:20:16 UTC (rev 110707)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h	2012-03-14 16:21:05 UTC (rev 110708)
@@ -123,6 +123,8 @@
     static bool supportsFullScreen(WKBundlePageRef, WKFullScreenKeyboardRequestType);
     static void enterFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element);
     static void exitFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element);
+    static void beganEnterFullScreen(WKBundlePageRef, WKRect initialFrame, WKRect finalFrame);
+    static void beganExitFullScreen(WKBundlePageRef, WKRect initialFrame, WKRect finalFrame);
 #endif
 
     // Editor client
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to