Changeset 185721 in webkit


Ignore:
Timestamp:
Jun 18, 2015 1:59:12 PM (9 years ago)
Author:
andersca@apple.com
Message:

Remove shouldInterruptJavaScript
https://bugs.webkit.org/show_bug.cgi?id=146118

Reviewed by Antti Koivisto.

Source/WebCore:

The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
to interrupt execution (by closing the browser tab or window) from the UI process.

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::shouldInterruptScript):

  • loader/EmptyClients.h:
  • page/Chrome.cpp:

(WebCore::Chrome::shouldInterruptJavaScript): Deleted.

  • page/Chrome.h:
  • page/ChromeClient.h:

Source/WebKit/mac:

  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.mm:

(WebChromeClient::shouldInterruptJavaScript): Deleted.

  • WebView/WebUIDelegatePrivate.h:

Source/WebKit/win:

  • Interfaces/IWebUIDelegatePrivate.idl:
  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::shouldInterruptJavaScript): Deleted.

  • WebCoreSupport/WebChromeClient.h:

Source/WebKit2:

  • UIProcess/API/APIUIClient.h:

(API::UIClient::shouldInterruptJavaScript): Deleted.

  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPageUIClient): Deleted.

  • UIProcess/API/C/WKPageUIClient.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::shouldInterruptJavaScript): Deleted.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::shouldInterruptJavaScript): Deleted.

  • WebProcess/WebCoreSupport/WebChromeClient.h:
Location:
trunk/Source
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185719 r185721  
     12015-06-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove shouldInterruptJavaScript
     4        https://bugs.webkit.org/show_bug.cgi?id=146118
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
     9        for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
     10        to interrupt execution (by closing the browser tab or window) from the UI process.
     11
     12        * bindings/js/JSDOMWindowBase.cpp:
     13        (WebCore::JSDOMWindowBase::shouldInterruptScript):
     14        * loader/EmptyClients.h:
     15        * page/Chrome.cpp:
     16        (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
     17        * page/Chrome.h:
     18        * page/ChromeClient.h:
     19
    1202015-06-18  Benjamin Poulain  <bpoulain@apple.com>
    221
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp

    r185346 r185721  
    150150    ASSERT(thisObject->impl().frame());
    151151    Page* page = thisObject->impl().frame()->page();
    152     return shouldInterruptScriptToPreventInfiniteRecursionWhenClosingPage(page) || page->chrome().shouldInterruptJavaScript();
     152    return shouldInterruptScriptToPreventInfiniteRecursionWhenClosingPage(page);
    153153}
    154154
  • trunk/Source/WebCore/loader/EmptyClients.h

    r185542 r185721  
    115115    virtual bool runJavaScriptConfirm(Frame*, const String&) override { return false; }
    116116    virtual bool runJavaScriptPrompt(Frame*, const String&, const String&, String&) override { return false; }
    117     virtual bool shouldInterruptJavaScript() override { return false; }
    118117
    119118    virtual bool selectItemWritingDirectionIsNatural() override { return false; }
  • trunk/Source/WebCore/page/Chrome.cpp

    r185337 r185721  
    348348}
    349349
    350 bool Chrome::shouldInterruptJavaScript()
    351 {
    352     // Defer loads in case the client method runs a new event loop that would
    353     // otherwise cause the load to continue while we're in the middle of executing JavaScript.
    354     PageGroupLoadDeferrer deferrer(m_page, true);
    355 
    356     return m_client.shouldInterruptJavaScript();
    357 }
    358 
    359350IntRect Chrome::windowResizerRect() const
    360351{
  • trunk/Source/WebCore/page/Chrome.h

    r185337 r185721  
    146146    bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
    147147    WEBCORE_EXPORT void setStatusbarText(Frame*, const String&);
    148     bool shouldInterruptJavaScript();
    149148
    150149    IntRect windowResizerRect() const;
  • trunk/Source/WebCore/page/ChromeClient.h

    r185337 r185721  
    147147    virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) = 0;
    148148    virtual void setStatusbarText(const String&) = 0;
    149     virtual bool shouldInterruptJavaScript() = 0;
    150149    virtual KeyboardUIMode keyboardUIMode() = 0;
    151150
  • trunk/Source/WebKit/mac/ChangeLog

    r185714 r185721  
     12015-06-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove shouldInterruptJavaScript
     4        https://bugs.webkit.org/show_bug.cgi?id=146118
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebCoreSupport/WebChromeClient.h:
     9        * WebCoreSupport/WebChromeClient.mm:
     10        (WebChromeClient::shouldInterruptJavaScript): Deleted.
     11        * WebView/WebUIDelegatePrivate.h:
     12
    1132015-06-17  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h

    r184670 r185721  
    9090    virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&) override;
    9191    virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result) override;
    92     virtual bool shouldInterruptJavaScript() override;
    9392
    9493    virtual WebCore::IntRect windowResizerRect() const override;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r185714 r185721  
    549549}
    550550
    551 bool WebChromeClient::shouldInterruptJavaScript()
    552 {
    553     return CallUIDelegateReturningBoolean(NO, m_webView, @selector(webViewShouldInterruptJavaScript:));
    554 }
    555 
    556551void WebChromeClient::setStatusbarText(const String& status)
    557552{
  • trunk/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r184780 r185721  
    215215- (void)webView:(WebView *)sender didDrawRect:(NSRect)rect;
    216216- (void)webView:(WebView *)sender didScrollDocumentInFrameView:(WebFrameView *)frameView;
    217 // FIXME: If we ever make this method public, it should include a WebFrame parameter.
    218 - (BOOL)webViewShouldInterruptJavaScript:(WebView *)sender;
    219217#if !TARGET_OS_IPHONE
    220218- (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu;
  • trunk/Source/WebKit/win/ChangeLog

    r185691 r185721  
     12015-06-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove shouldInterruptJavaScript
     4        https://bugs.webkit.org/show_bug.cgi?id=146118
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * Interfaces/IWebUIDelegatePrivate.idl:
     9        * WebCoreSupport/WebChromeClient.cpp:
     10        (WebChromeClient::shouldInterruptJavaScript): Deleted.
     11        * WebCoreSupport/WebChromeClient.h:
     12
    1132015-06-17  Hyungwook Lee  <hyungwook.lee@navercorp.com>
    214
  • trunk/Source/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl

    r172977 r185721  
    5555    HRESULT webViewScrolled([in] IWebView* sender);
    5656    HRESULT webViewAddMessageToConsole([in] IWebView* sender, [in] BSTR message, [in] int lineNumber, [in] BSTR url, [in] BOOL isError);
    57     HRESULT webViewShouldInterruptJavaScript([in] IWebView* sender, [out, retval] BOOL* result);
     57    HRESULT unused3();
    5858    HRESULT webViewReceivedFocus([in] IWebView* sender);
    5959    HRESULT webViewLostFocus([in] IWebView* sender, [in] HWND loseFocusToHWnd);
     
    6363    HRESULT exceededDatabaseQuota([in] IWebView* sender, [in] IWebFrame* frame, [in] IWebSecurityOrigin* origin, [in] BSTR databaseIdentifier);
    6464    HRESULT embeddedViewWithArguments([in] IWebView* sender, [in] IWebFrame* frame, [in] IPropertyBag* arguments, [out, retval] IWebEmbeddedView** view);
    65     HRESULT unused3();
     65    HRESULT unused4();
    6666    HRESULT webViewClosing([in] IWebView* sender);
    6767    HRESULT webViewSetCursor([in] IWebView* sender, [in] HCURSOR cursor);
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r183234 r185721  
    432432}
    433433
    434 bool WebChromeClient::shouldInterruptJavaScript()
    435 {
    436     COMPtr<IWebUIDelegate> uiDelegate;
    437     if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
    438         COMPtr<IWebUIDelegatePrivate> uiPrivate;
    439         if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate))) {
    440             BOOL result;
    441             if (SUCCEEDED(uiPrivate->webViewShouldInterruptJavaScript(m_webView, &result)))
    442                 return !!result;
    443         }
    444     }
    445     return false;
    446 }
    447 
    448434KeyboardUIMode WebChromeClient::keyboardUIMode()
    449435{
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r183529 r185721  
    8989    virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result);
    9090    virtual void setStatusbarText(const WTF::String&);
    91     virtual bool shouldInterruptJavaScript();
    9291
    9392    virtual WebCore::KeyboardUIMode keyboardUIMode();
  • trunk/Source/WebKit2/ChangeLog

    r185706 r185721  
     12015-06-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove shouldInterruptJavaScript
     4        https://bugs.webkit.org/show_bug.cgi?id=146118
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * UIProcess/API/APIUIClient.h:
     9        (API::UIClient::shouldInterruptJavaScript): Deleted.
     10        * UIProcess/API/C/WKPage.cpp:
     11        (WKPageSetPageUIClient): Deleted.
     12        * UIProcess/API/C/WKPageUIClient.h:
     13        * UIProcess/WebPageProxy.cpp:
     14        (WebKit::WebPageProxy::shouldInterruptJavaScript): Deleted.
     15        * UIProcess/WebPageProxy.h:
     16        * UIProcess/WebPageProxy.messages.in:
     17        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     18        (WebKit::WebChromeClient::shouldInterruptJavaScript): Deleted.
     19        * WebProcess/WebCoreSupport/WebChromeClient.h:
     20
    1212015-06-18  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/APIUIClient.h

    r181408 r185721  
    142142    virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, const WTF::String&, API::Data*) { }
    143143
    144     virtual bool shouldInterruptJavaScript(WebKit::WebPageProxy*) { return false; }
    145 
    146144    virtual void pinnedStateDidChange(WebKit::WebPageProxy&) { }
    147145
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r185554 r185721  
    17301730        }
    17311731
    1732         virtual bool shouldInterruptJavaScript(WebPageProxy* page) override
    1733         {
    1734             if (!m_client.shouldInterruptJavaScript)
    1735                 return false;
    1736 
    1737             return m_client.shouldInterruptJavaScript(toAPI(page), m_client.base.clientInfo);
    1738         }
    1739 
    17401732        virtual void pinnedStateDidChange(WebPageProxy& page) override
    17411733        {
  • trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h

    r181408 r185721  
    8181typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
    8282typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
    83 typedef bool (*WKPageShouldInterruptJavaScriptCallback)(WKPageRef page, const void *clientInfo);
    8483typedef void (*WKPageDecidePolicyForNotificationPermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void *clientInfo);
    8584typedef void (*WKPageShowColorPickerCallback)(WKPageRef page, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo);
     
    147146    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    148147    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    149     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;   
     148    void*                                                               shouldInterruptJavaScript_unavailable;
    150149} WKPageUIClientV0;
    151150
     
    192191    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    193192    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    194     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;   
     193    void*                                                               shouldInterruptJavaScript_unavailable;
    195194
    196195    // Version 1.
     
    243242    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    244243    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    245     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;   
     244    void*                                                               shouldInterruptJavaScript_unavailable;
    246245
    247246    // Version 1.
     
    299298    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    300299    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    301     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;   
     300    void*                                                               shouldInterruptJavaScript_unavailable;
    302301
    303302    // Version 1.
     
    358357    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    359358    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    360     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;
     359    void*                                                               shouldInterruptJavaScript_unavailable;
    361360
    362361    // Version 1.
     
    423422    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    424423    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    425     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;
     424    void*                                                               shouldInterruptJavaScript_unavailable;
    426425
    427426    // Version 1.
     
    494493    void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
    495494    WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
    496     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;   
     495    void*                                                               shouldInterruptJavaScript_unavailable;
    497496
    498497    // Version 1.
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r185637 r185721  
    34983498}
    34993499
    3500 void WebPageProxy::shouldInterruptJavaScript(bool& result)
    3501 {
    3502     // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
    3503     m_process->responsivenessTimer()->stop();
    3504 
    3505     result = m_uiClient->shouldInterruptJavaScript(this);
    3506 }
    3507 
    35083500void WebPageProxy::setStatusText(const String& text)
    35093501{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r185661 r185721  
    11421142    void runJavaScriptConfirm(uint64_t frameID, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
    11431143    void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
    1144     void shouldInterruptJavaScript(bool& result);
    11451144    void setStatusText(const String&);
    11461145    void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, const UserData&);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r185661 r185721  
    2929    RunJavaScriptConfirm(uint64_t frameID, String message) -> (bool result) Delayed
    3030    RunJavaScriptPrompt(uint64_t frameID, String message, String defaultValue) -> (String result) Delayed
    31     ShouldInterruptJavaScript() -> (bool shouldInterupt)
    3231    MouseDidMoveOverElement(WebKit::WebHitTestResult::Data hitTestResultData, uint32_t modifiers, WebKit::UserData userData)
    3332
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r185479 r185721  
    422422}
    423423
    424 bool WebChromeClient::shouldInterruptJavaScript()
    425 {
    426     bool shouldInterrupt = false;
    427     if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::ShouldInterruptJavaScript(), Messages::WebPageProxy::ShouldInterruptJavaScript::Reply(shouldInterrupt), m_page->pageID()))
    428         return false;
    429 
    430     return shouldInterrupt;
    431 }
    432 
    433424KeyboardUIMode WebChromeClient::keyboardUIMode()
    434425{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r184670 r185721  
    102102    virtual bool runJavaScriptPrompt(WebCore::Frame*, const String& message, const String& defaultValue, String& result) override;
    103103    virtual void setStatusbarText(const String&) override;
    104     virtual bool shouldInterruptJavaScript() override;
    105104
    106105    virtual WebCore::KeyboardUIMode keyboardUIMode() override;
Note: See TracChangeset for help on using the changeset viewer.