Changeset 194330 in webkit


Ignore:
Timestamp:
Dec 21, 2015 7:16:58 AM (8 years ago)
Author:
mitz@apple.com
Message:

Different and incorrect flags are passed to sendSync when accessibility is enabled, SpinRunLoopWhileWaitingForReply
https://bugs.webkit.org/show_bug.cgi?id=126021

Reviewed by Darin Adler.

Get rid of SpinRunLoopWhileWaitingForReply because it’s not used anymore.

  • Platform/IPC/Connection.cpp:

(IPC::Connection::waitForSyncReply): Removed the SpinRunLoopWhileWaitingForReply branch.

  • Platform/IPC/Connection.h: Removed SpinRunLoopWhileWaitingForReply.
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Don’t check

WebPage::synchronousMessagesShouldSpinRunLoop() and don’t specify
SpinRunLoopWhileWaitingForReply.

(WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
(WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
(WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
(WebKit::WebChromeClient::print): Ditto.
(WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Ditto.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::synchronousMessagesShouldSpinRunLoop): Deleted.

  • WebProcess/WebPage/WebPage.h:
Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r194325 r194330  
     12015-12-21  Dan Bernstein  <mitz@apple.com>
     2
     3        Different and incorrect flags are passed to sendSync when accessibility is enabled, SpinRunLoopWhileWaitingForReply
     4        https://bugs.webkit.org/show_bug.cgi?id=126021
     5
     6        Reviewed by Darin Adler.
     7
     8        Get rid of SpinRunLoopWhileWaitingForReply because it’s not used anymore.
     9
     10        * Platform/IPC/Connection.cpp:
     11        (IPC::Connection::waitForSyncReply): Removed the SpinRunLoopWhileWaitingForReply branch.
     12
     13        * Platform/IPC/Connection.h: Removed SpinRunLoopWhileWaitingForReply.
     14
     15        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     16        (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Don’t check
     17          WebPage::synchronousMessagesShouldSpinRunLoop() and don’t specify
     18          SpinRunLoopWhileWaitingForReply.
     19        (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
     20        (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
     21        (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
     22        (WebKit::WebChromeClient::print): Ditto.
     23        (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
     24        (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
     25
     26        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     27        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Ditto.
     28
     29        * WebProcess/WebPage/WebPage.cpp:
     30        (WebKit::WebPage::synchronousMessagesShouldSpinRunLoop): Deleted.
     31        * WebProcess/WebPage/WebPage.h:
     32
    1332015-12-20  Joonghun Park  <jh718.park@samsung.com>
    234
  • trunk/Source/WebKit2/Platform/IPC/Connection.cpp

    r189546 r194330  
    583583        // This allows the WebProcess to still serve clients while waiting for the message to return.
    584584        // Notably, it can continue to process accessibility requests, which are on the main thread.
    585         if (syncSendFlags & SpinRunLoopWhileWaitingForReply) {
    586 #if PLATFORM(COCOA)
    587             // FIXME: Although we run forever, any events incoming will cause us to drop out and exit out. This however doesn't
    588             // account for a timeout value passed in. Timeout is always NoTimeout in these cases, but that could change.
    589             RunLoop::current().runForDuration(1e10);
    590             timedOut = currentTime() >= absoluteTime;
    591 #endif
    592         } else
    593             timedOut = !SyncMessageState::singleton().wait(absoluteTime);
    594        
    595     }
    596    
     585        timedOut = !SyncMessageState::singleton().wait(absoluteTime);
     586    }
     587
    597588    didReceiveSyncReply(syncSendFlags);
    598589
  • trunk/Source/WebKit2/Platform/IPC/Connection.h

    r191881 r194330  
    7070    // Use this to inform that this sync call will suspend this process until the user responds with input.
    7171    InformPlatformProcessWillSuspend = 1 << 0,
    72     // Some platform accessibility clients can't suspend gracefully and need to spin the run loop so WebProcess doesn't hang.
    73     // FIXME (126021): Remove when no platforms need to support this.
    74     SpinRunLoopWhileWaitingForReply = 1 << 1,
    75     UseFullySynchronousModeForTesting = 1 << 2,
     72    UseFullySynchronousModeForTesting = 1 << 1,
    7673};
    7774
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r194108 r194330  
    342342    HangDetectionDisabler hangDetectionDisabler;
    343343
    344     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    345     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    346         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    347    
    348     if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
     344    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
    349345        return false;
    350346
     
    381377    HangDetectionDisabler hangDetectionDisabler;
    382378
    383     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    384     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    385         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    386     WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
     379    WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
    387380}
    388381
     
    397390    HangDetectionDisabler hangDetectionDisabler;
    398391
    399     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    400     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    401         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    402392    bool result = false;
    403     if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
     393    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
    404394        return false;
    405395
     
    417407    HangDetectionDisabler hangDetectionDisabler;
    418408
    419     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    420     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    421         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    422    
    423     if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
     409    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
    424410        return false;
    425411
     
    645631#endif
    646632
    647     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    648     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    649         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    650    
    651     m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), syncSendFlags);
     633    m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
    652634}
    653635
     
    667649
    668650    if (!newQuota) {
    669         unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    670         if (WebPage::synchronousMessagesShouldSpinRunLoop())
    671             syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    672        
    673651        WebProcess::singleton().parentProcessConnection()->sendSync(
    674652            Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
    675             Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
     653            Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
    676654    }
    677655
     
    689667    if (m_page->injectedBundleUIClient().didReachApplicationCacheOriginQuota(m_page, securityOrigin.get(), totalBytesNeeded))
    690668        return;
    691 
    692     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    693     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    694         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    695669
    696670    auto& cacheStorage = ApplicationCacheStorage::singleton();
     
    702676    WebProcess::singleton().parentProcessConnection()->sendSync(
    703677        Messages::WebPageProxy::ReachedApplicationCacheOriginQuota(origin->databaseIdentifier(), currentQuota, totalBytesNeeded),
    704         Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
     678        Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
    705679
    706680    cacheStorage.storeUpdatedQuotaForOrigin(origin, newQuota);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r194264 r194330  
    697697    DownloadID downloadID;
    698698
    699     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
    700     if (WebPage::synchronousMessagesShouldSpinRunLoop())
    701         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
    702 
    703699    WebCore::Frame* coreFrame = m_frame ? m_frame->coreFrame() : nullptr;
    704     if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), std::chrono::milliseconds::max(), syncSendFlags)) {
     700    if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend)) {
    705701        m_frame->didReceivePolicyDecision(listenerID, PolicyIgnore, 0, { });
    706702        return;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r194318 r194330  
    50085008}
    50095009   
    5010 bool WebPage::synchronousMessagesShouldSpinRunLoop()
    5011 {
    5012     return false;
    5013 }
    5014 
    50155010void WebPage::didChangeScrollOffsetForFrame(Frame* frame)
    50165011{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r194274 r194330  
    882882    void getBytecodeProfile(uint64_t callbackID);
    883883   
    884     // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
    885     // While this is not ideal, it does not have to be applied to every platform at the moment.
    886     static bool synchronousMessagesShouldSpinRunLoop();
    887 
    888884#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
    889885    void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
Note: See TracChangeset for help on using the changeset viewer.