Title: [194330] trunk/Source/WebKit2
Revision
194330
Author
[email protected]
Date
2015-12-21 07:16:58 -0800 (Mon, 21 Dec 2015)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (194329 => 194330)


--- trunk/Source/WebKit2/ChangeLog	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/ChangeLog	2015-12-21 15:16:58 UTC (rev 194330)
@@ -1,3 +1,35 @@
+2015-12-21  Dan Bernstein  <[email protected]>
+
+        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:
+
 2015-12-20  Joonghun Park  <[email protected]>
 
         [WK2][EFL] Use WebsiteDataStore instead of WebDatabaseManager which has been deleted in r194295

Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (194329 => 194330)


--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2015-12-21 15:16:58 UTC (rev 194330)
@@ -582,18 +582,9 @@
         // We didn't find a sync reply yet, keep waiting.
         // This allows the WebProcess to still serve clients while waiting for the message to return.
         // Notably, it can continue to process accessibility requests, which are on the main thread.
-        if (syncSendFlags & SpinRunLoopWhileWaitingForReply) {
-#if PLATFORM(COCOA)
-            // FIXME: Although we run forever, any events incoming will cause us to drop out and exit out. This however doesn't
-            // account for a timeout value passed in. Timeout is always NoTimeout in these cases, but that could change.
-            RunLoop::current().runForDuration(1e10);
-            timedOut = currentTime() >= absoluteTime;
-#endif
-        } else
-            timedOut = !SyncMessageState::singleton().wait(absoluteTime);
-        
+        timedOut = !SyncMessageState::singleton().wait(absoluteTime);
     }
-    
+
     didReceiveSyncReply(syncSendFlags);
 
     return nullptr;

Modified: trunk/Source/WebKit2/Platform/IPC/Connection.h (194329 => 194330)


--- trunk/Source/WebKit2/Platform/IPC/Connection.h	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.h	2015-12-21 15:16:58 UTC (rev 194330)
@@ -69,10 +69,7 @@
 enum SyncMessageSendFlags {
     // Use this to inform that this sync call will suspend this process until the user responds with input.
     InformPlatformProcessWillSuspend = 1 << 0,
-    // Some platform accessibility clients can't suspend gracefully and need to spin the run loop so WebProcess doesn't hang.
-    // FIXME (126021): Remove when no platforms need to support this.
-    SpinRunLoopWhileWaitingForReply = 1 << 1,
-    UseFullySynchronousModeForTesting = 1 << 2,
+    UseFullySynchronousModeForTesting = 1 << 1,
 };
 
 enum WaitForMessageFlags {

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (194329 => 194330)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2015-12-21 15:16:58 UTC (rev 194330)
@@ -341,11 +341,7 @@
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-    
-    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
+    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))
         return false;
 
     return shouldClose;
@@ -380,10 +376,7 @@
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-    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);
+    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);
 }
 
 bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
@@ -396,11 +389,8 @@
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
     bool result = false;
-    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))
+    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))
         return false;
 
     return result;
@@ -416,11 +406,7 @@
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-    
-    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))
+    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))
         return false;
 
     return !result.isNull();
@@ -644,11 +630,7 @@
     }
 #endif
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-    
-    m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), syncSendFlags);
+    m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
 }
 
 void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
@@ -666,13 +648,9 @@
     newQuota = m_page->injectedBundleUIClient().didExceedDatabaseQuota(m_page, securityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
 
     if (!newQuota) {
-        unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-        if (WebPage::synchronousMessagesShouldSpinRunLoop())
-            syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-        
         WebProcess::singleton().parentProcessConnection()->sendSync(
             Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
-            Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
+            Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
     }
 
     dbManager.setQuota(origin, newQuota);
@@ -689,10 +667,6 @@
     if (m_page->injectedBundleUIClient().didReachApplicationCacheOriginQuota(m_page, securityOrigin.get(), totalBytesNeeded))
         return;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-
     auto& cacheStorage = ApplicationCacheStorage::singleton();
     int64_t currentQuota = 0;
     if (!cacheStorage.calculateQuotaForOrigin(origin, currentQuota))
@@ -701,7 +675,7 @@
     uint64_t newQuota = 0;
     WebProcess::singleton().parentProcessConnection()->sendSync(
         Messages::WebPageProxy::ReachedApplicationCacheOriginQuota(origin->databaseIdentifier(), currentQuota, totalBytesNeeded),
-        Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
+        Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
 
     cacheStorage.storeUpdatedQuotaForOrigin(origin, newQuota);
 }

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (194329 => 194330)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2015-12-21 15:16:58 UTC (rev 194330)
@@ -696,12 +696,8 @@
     uint64_t policyAction;
     DownloadID downloadID;
 
-    unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
-    if (WebPage::synchronousMessagesShouldSpinRunLoop())
-        syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-
     WebCore::Frame* coreFrame = m_frame ? m_frame->coreFrame() : nullptr;
-    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)) {
+    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)) {
         m_frame->didReceivePolicyDecision(listenerID, PolicyIgnore, 0, { });
         return;
     }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (194329 => 194330)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-21 15:16:58 UTC (rev 194330)
@@ -5007,11 +5007,6 @@
     return TextIterator::rangeFromLocationAndLength(frame.selection().rootEditableElementOrDocumentElement(), static_cast<int>(range.location), length);
 }
     
-bool WebPage::synchronousMessagesShouldSpinRunLoop()
-{
-    return false;
-}
-
 void WebPage::didChangeScrollOffsetForFrame(Frame* frame)
 {
     if (!frame->isMainFrame())

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (194329 => 194330)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2015-12-21 15:15:23 UTC (rev 194329)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2015-12-21 15:16:58 UTC (rev 194330)
@@ -881,10 +881,6 @@
 
     void getBytecodeProfile(uint64_t callbackID);
     
-    // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
-    // While this is not ideal, it does not have to be applied to every platform at the moment.
-    static bool synchronousMessagesShouldSpinRunLoop();
-
 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to