Title: [196720] trunk/Source/WebKit2
Revision
196720
Author
ander...@apple.com
Date
2016-02-17 13:46:12 -0800 (Wed, 17 Feb 2016)

Log Message

Need listener-based version of runBeforeUnloadConfirmPanel
https://bugs.webkit.org/show_bug.cgi?id=154354
rdar://problem/23736691

Reviewed by Sam Weinig.

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::runBeforeUnloadConfirmPanel):
* UIProcess/API/C/WKPage.cpp:
(fixUpBotchedPageUIClient):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::~RunBeforeUnloadConfirmPanelResultListener):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::call):
(WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID):
(WKPageRunBeforeUnloadConfirmPanelResultListenerCall):
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (196719 => 196720)


--- trunk/Source/WebKit2/ChangeLog	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-17 21:46:12 UTC (rev 196720)
@@ -1,3 +1,29 @@
+2016-02-17  Anders Carlsson  <ander...@apple.com>
+
+        Need listener-based version of runBeforeUnloadConfirmPanel
+        https://bugs.webkit.org/show_bug.cgi?id=154354
+        rdar://problem/23736691
+
+        Reviewed by Sam Weinig.
+
+        * Shared/API/APIObject.h:
+        * Shared/API/c/WKBase.h:
+        * UIProcess/API/APIUIClient.h:
+        (API::UIClient::runBeforeUnloadConfirmPanel):
+        * UIProcess/API/C/WKPage.cpp:
+        (fixUpBotchedPageUIClient):
+        (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
+        (WebKit::RunBeforeUnloadConfirmPanelResultListener::~RunBeforeUnloadConfirmPanelResultListener):
+        (WebKit::RunBeforeUnloadConfirmPanelResultListener::call):
+        (WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID):
+        (WKPageRunBeforeUnloadConfirmPanelResultListenerCall):
+        (WKPageSetPageUIClient):
+        * UIProcess/API/C/WKPageUIClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+
 2016-02-17  Simon Fraser  <simon.fra...@apple.com>
 
         PDFPlugin's scrollableArea container is not properly unregistered when page is going into the PageCache

Modified: trunk/Source/WebKit2/Shared/API/APIObject.h (196719 => 196720)


--- trunk/Source/WebKit2/Shared/API/APIObject.h	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/Shared/API/APIObject.h	2016-02-17 21:46:12 UTC (rev 196720)
@@ -138,6 +138,7 @@
         ProcessPoolConfiguration,
         PluginSiteDataManager,
         Preferences,
+        RunBeforeUnloadConfirmPanelResultListener,
         RunJavaScriptAlertResultListener,
         RunJavaScriptConfirmResultListener,
         RunJavaScriptPromptResultListener,

Modified: trunk/Source/WebKit2/Shared/API/c/WKBase.h (196719 => 196720)


--- trunk/Source/WebKit2/Shared/API/c/WKBase.h	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/Shared/API/c/WKBase.h	2016-02-17 21:46:12 UTC (rev 196720)
@@ -128,6 +128,7 @@
 typedef const struct OpaqueWKPluginSiteDataManager* WKPluginSiteDataManagerRef;
 typedef const struct OpaqueWKPreferences* WKPreferencesRef;
 typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
+typedef const struct OpaqueWKPageRunBeforeUnloadConfirmPanelResultListener* WKPageRunBeforeUnloadConfirmPanelResultListenerRef;
 typedef const struct OpaqueWKPageRunJavaScriptAlertResultListener* WKPageRunJavaScriptAlertResultListenerRef;
 typedef const struct OpaqueWKPageRunJavaScriptConfirmResultListener* WKPageRunJavaScriptConfirmResultListenerRef;
 typedef const struct OpaqueWKPageRunJavaScriptPromptResultListener* WKPageRunJavaScriptPromptResultListenerRef;

Modified: trunk/Source/WebKit2/UIProcess/API/APIUIClient.h (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/API/APIUIClient.h	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/API/APIUIClient.h	2016-02-17 21:46:12 UTC (rev 196720)
@@ -116,7 +116,7 @@
     virtual WebCore::FloatRect windowFrame(WebKit::WebPageProxy*) { return WebCore::FloatRect(); }
 
     virtual bool canRunBeforeUnloadConfirmPanel() const { return false; }
-    virtual bool runBeforeUnloadConfirmPanel(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebFrameProxy*) { return true; }
+    virtual void runBeforeUnloadConfirmPanel(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebFrameProxy*, std::function<void (bool)> completionHandler) { completionHandler(true); }
 
     virtual void pageDidScroll(WebKit::WebPageProxy*) { }
 

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-02-17 21:46:12 UTC (rev 196720)
@@ -107,7 +107,7 @@
 };
 
 template<> struct ClientTraits<WKPageUIClientBase> {
-    typedef std::tuple<WKPageUIClientV0, WKPageUIClientV1, WKPageUIClientV2, WKPageUIClientV3, WKPageUIClientV4, WKPageUIClientV5, WKPageUIClientV6> Versions;
+    typedef std::tuple<WKPageUIClientV0, WKPageUIClientV1, WKPageUIClientV2, WKPageUIClientV3, WKPageUIClientV4, WKPageUIClientV5, WKPageUIClientV6, WKPageUIClientV7> Versions;
 };
 
 #if ENABLE(CONTEXT_MENUS)
@@ -1410,7 +1410,7 @@
         WKPageSetIsResizableCallback                                        setIsResizable;
         WKPageGetWindowFrameCallback                                        getWindowFrame;
         WKPageSetWindowFrameCallback                                        setWindowFrame;
-        WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+        WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
         WKPageUIClientCallback                                              didDraw;
         WKPageUIClientCallback                                              pageDidScroll;
         WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -1515,6 +1515,31 @@
 
 namespace WebKit {
 
+class RunBeforeUnloadConfirmPanelResultListener : public API::ObjectImpl<API::Object::Type::RunBeforeUnloadConfirmPanelResultListener> {
+public:
+    static PassRefPtr<RunBeforeUnloadConfirmPanelResultListener> create(std::function<void (bool)>&& completionHandler)
+    {
+        return adoptRef(new RunBeforeUnloadConfirmPanelResultListener(WTFMove(completionHandler)));
+    }
+
+    virtual ~RunBeforeUnloadConfirmPanelResultListener()
+    {
+    }
+
+    void call(bool result)
+    {
+        m_completionHandler(result);
+    }
+
+private:
+    explicit RunBeforeUnloadConfirmPanelResultListener(std::function<void (bool)>&& completionHandler)
+        : m_completionHandler(WTFMove(completionHandler))
+    {
+    }
+
+    std::function<void (bool)> m_completionHandler;
+};
+
 class RunJavaScriptAlertResultListener : public API::ObjectImpl<API::Object::Type::RunJavaScriptAlertResultListener> {
 public:
     static PassRefPtr<RunJavaScriptAlertResultListener> create(std::function<void ()>&& completionHandler)
@@ -1590,12 +1615,23 @@
     std::function<void (const String&)> m_completionHandler;
 };
 
+WK_ADD_API_MAPPING(WKPageRunBeforeUnloadConfirmPanelResultListenerRef, RunBeforeUnloadConfirmPanelResultListener)
 WK_ADD_API_MAPPING(WKPageRunJavaScriptAlertResultListenerRef, RunJavaScriptAlertResultListener)
 WK_ADD_API_MAPPING(WKPageRunJavaScriptConfirmResultListenerRef, RunJavaScriptConfirmResultListener)
 WK_ADD_API_MAPPING(WKPageRunJavaScriptPromptResultListenerRef, RunJavaScriptPromptResultListener)
 
 }
 
+WKTypeID WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID()
+{
+    return toAPI(RunBeforeUnloadConfirmPanelResultListener::APIType);
+}
+
+void WKPageRunBeforeUnloadConfirmPanelResultListenerCall(WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, bool result)
+{
+    toImpl(listener)->call(result);
+}
+
 WKTypeID WKPageRunJavaScriptAlertResultListenerGetTypeID()
 {
     return toAPI(RunJavaScriptAlertResultListener::APIType);
@@ -1971,15 +2007,24 @@
 
         virtual bool canRunBeforeUnloadConfirmPanel() const override
         {
-            return m_client.runBeforeUnloadConfirmPanel;
+            return m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6 || m_client.runBeforeUnloadConfirmPanel;
         }
 
-        virtual bool runBeforeUnloadConfirmPanel(WebPageProxy* page, const String& message, WebFrameProxy* frame) override
+        virtual void runBeforeUnloadConfirmPanel(WebKit::WebPageProxy* page, const WTF::String& message, WebKit::WebFrameProxy* frame, std::function<void (bool)> completionHandler) override
         {
-            if (!m_client.runBeforeUnloadConfirmPanel)
-                return true;
+            if (m_client.runBeforeUnloadConfirmPanel) {
+                RefPtr<RunBeforeUnloadConfirmPanelResultListener> listener = RunBeforeUnloadConfirmPanelResultListener::create(WTFMove(completionHandler));
+                m_client.runBeforeUnloadConfirmPanel(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(listener.get()), m_client.base.clientInfo);
+                return;
+            }
 
-            return m_client.runBeforeUnloadConfirmPanel(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+            if (m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6) {
+                bool result = m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+                completionHandler(result);
+                return;
+            }
+
+            completionHandler(true);
         }
 
         virtual void pageDidScroll(WebPageProxy* page) override

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h	2016-02-17 21:46:12 UTC (rev 196720)
@@ -48,6 +48,8 @@
 };
 typedef uint32_t WKPluginUnavailabilityReason;
 
+WK_EXPORT WKTypeID WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID();
+WK_EXPORT void WKPageRunBeforeUnloadConfirmPanelResultListenerCall(WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, bool result);
 
 WK_EXPORT WKTypeID WKPageRunJavaScriptAlertResultListenerGetTypeID();
 WK_EXPORT void WKPageRunJavaScriptAlertResultListenerCall(WKPageRunJavaScriptAlertResultListenerRef listener);
@@ -60,6 +62,7 @@
 
 typedef void (*WKPageUIClientCallback)(WKPageRef page, const void* clientInfo);
 typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo);
+typedef void (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, const void *clientInfo);
 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptAlertResultListenerRef listener, const void *clientInfo);
 typedef void (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptConfirmResultListenerRef listener, const void *clientInfo);
 typedef void (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptPromptResultListenerRef listener, const void *clientInfo);
@@ -80,7 +83,6 @@
 typedef void (*WKPageSetIsResizableCallback)(WKPageRef page, bool resizable, const void *clientInfo);
 typedef WKRect (*WKPageGetWindowFrameCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const void *clientInfo);
-typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
 typedef unsigned long long (*WKPageExceededDatabaseQuotaCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void *clientInfo);
 typedef void (*WKPageRunOpenPanelCallback)(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo);
 typedef void (*WKPageDecidePolicyForGeolocationPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo);
@@ -113,8 +115,8 @@
 typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
 typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
 
-
 typedef struct WKPageUIClientBase {
     int                                                                 version;
     const void *                                                        clientInfo;
@@ -148,7 +150,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -193,7 +195,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -244,7 +246,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -300,7 +302,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -359,7 +361,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -424,7 +426,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -497,7 +499,7 @@
     WKPageSetIsResizableCallback                                        setIsResizable;
     WKPageGetWindowFrameCallback                                        getWindowFrame;
     WKPageSetWindowFrameCallback                                        setWindowFrame;
-    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel;
     WKPageUIClientCallback                                              didDraw;
     WKPageUIClientCallback                                              pageDidScroll;
     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
@@ -549,6 +551,89 @@
     WKCheckUserMediaPermissionCallback                                  checkUserMediaPermissionForOrigin;
 } WKPageUIClientV6;
 
+typedef struct WKPageUIClientV7 {
+    WKPageUIClientBase                                                  base;
+
+    // Version 0.
+    WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
+    WKPageUIClientCallback                                              showPage;
+    WKPageUIClientCallback                                              close;
+    WKPageTakeFocusCallback                                             takeFocus;
+    WKPageFocusCallback                                                 focus;
+    WKPageUnfocusCallback                                               unfocus;
+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
+    WKPageSetStatusTextCallback                                         setStatusText;
+    WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
+    WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
+    WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
+    WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
+    WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
+    WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
+    WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
+    WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
+    WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
+    WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
+    WKPageGetIsResizableCallback                                        isResizable;
+    WKPageSetIsResizableCallback                                        setIsResizable;
+    WKPageGetWindowFrameCallback                                        getWindowFrame;
+    WKPageSetWindowFrameCallback                                        setWindowFrame;
+    WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6    runBeforeUnloadConfirmPanel_deprecatedForUseWithV6;
+    WKPageUIClientCallback                                              didDraw;
+    WKPageUIClientCallback                                              pageDidScroll;
+    WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
+    WKPageRunOpenPanelCallback                                          runOpenPanel;
+    WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
+    WKPageHeaderHeightCallback                                          headerHeight;
+    WKPageFooterHeightCallback                                          footerHeight;
+    WKPageDrawHeaderCallback                                            drawHeader;
+    WKPageDrawFooterCallback                                            drawFooter;
+    WKPagePrintFrameCallback                                            printFrame;
+    WKPageUIClientCallback                                              runModal;
+    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
+    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
+    void*                                                               shouldInterruptJavaScript_unavailable;
+
+    // Version 1.
+    WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage_deprecatedForUseWithV1;
+    WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
+    WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
+    WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+    // Version 2.
+    WKPageShowColorPickerCallback                                       showColorPicker;
+    WKPageHideColorPickerCallback                                       hideColorPicker;
+    WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
+
+    // Version 3.
+    WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
+
+    // Version 4.
+    void*                                                               unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+    void*                                                               unused3; // Used to be didRecognizeLongMousePress.
+    void*                                                               unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+    WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
+
+    // Version 5.
+    WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
+    WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5             runJavaScriptAlert_deprecatedForUseWithV5;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5           runJavaScriptConfirm_deprecatedForUseWithV5;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5            runJavaScriptPrompt_deprecatedForUseWithV5;
+    WKPageMediaSessionMetadataDidChangeCallback                         mediaSessionMetadataDidChange;
+
+    // Version 6.
+    WKPageCreateNewPageCallback                                         createNewPage;
+    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
+    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
+    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
+    WKCheckUserMediaPermissionCallback                                  checkUserMediaPermissionForOrigin;
+
+    // Version 7.
+    WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
+} WKPageUIClientV7;
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-02-17 21:46:12 UTC (rev 196720)
@@ -3768,8 +3768,8 @@
     result = m_pageClient.rootViewToAccessibilityScreen(viewRect);
 }
 #endif
-    
-void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
+
+void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -3777,7 +3777,7 @@
     // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
     m_process->responsivenessTimer().stop();
 
-    shouldClose = m_uiClient->runBeforeUnloadConfirmPanel(this, message, frame);
+    m_uiClient->runBeforeUnloadConfirmPanel(this, message, frame, [reply](bool result) { reply->send(result); });
 }
 
 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-02-17 21:46:12 UTC (rev 196720)
@@ -1197,7 +1197,7 @@
     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
 #endif
-    void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
+    void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
     void pageDidScroll();
     void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (196719 => 196720)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-02-17 21:44:02 UTC (rev 196719)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-02-17 21:46:12 UTC (rev 196720)
@@ -69,7 +69,7 @@
     RootViewToAccessibilityScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame)
 #endif
 
-    RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -> (bool shouldClose)
+    RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -> (bool shouldClose) Delayed
     PageDidScroll()
     RunOpenPanel(uint64_t frameID, struct WebCore::FileChooserSettings parameters)
     PrintFrame(uint64_t frameID) -> ()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to