Title: [166769] trunk/Source/WebKit2
Revision
166769
Author
[email protected]
Date
2014-04-03 23:52:22 -0700 (Thu, 03 Apr 2014)

Log Message

AX: iOS does not need to spin the run loop on synchronous message calls
https://bugs.webkit.org/show_bug.cgi?id=131195

Reviewed by Dan Bernstein.

On the Mac platform, we need to spin the run loop while making synchronous calls to avoid VoiceOver hanging.
On iOS, this not needed due to architectural differences.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::synchronousMessagesShouldSpinRunLoop):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (166768 => 166769)


--- trunk/Source/WebKit2/ChangeLog	2014-04-04 06:26:54 UTC (rev 166768)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-04 06:52:22 UTC (rev 166769)
@@ -1,5 +1,25 @@
-2014-04-03  Andy Estes  <[email protected]>
+2014-04-03  Chris Fleizach  <[email protected]>
 
+        AX: iOS does not need to spin the run loop on synchronous message calls
+        https://bugs.webkit.org/show_bug.cgi?id=131195
+
+        Reviewed by Dan Bernstein.
+
+        On the Mac platform, we need to spin the run loop while making synchronous calls to avoid VoiceOver hanging.
+        On iOS, this not needed due to architectural differences.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::runJavaScriptAlert):
+        (WebKit::WebChromeClient::runJavaScriptConfirm):
+        (WebKit::WebChromeClient::runJavaScriptPrompt):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::synchronousMessagesShouldSpinRunLoop):
+        * WebProcess/WebPage/WebPage.h:
+
+2014-04-03 Andy Estes <[email protected]>
+
         [Cocoa] Add additional WKWebView SPI for clients that interact with PDFs
         https://bugs.webkit.org/show_bug.cgi?id=131206
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (166768 => 166769)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2014-04-04 06:26:54 UTC (rev 166768)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2014-04-04 06:52:22 UTC (rev 166769)
@@ -356,7 +356,7 @@
     m_page->injectedBundleUIClient().willRunJavaScriptAlert(m_page, alertText, webFrame);
 
     // FIXME (126021): It is not good to change IPC behavior conditionally, and SpinRunLoopWhileWaitingForReply was known to cause trouble in other similar cases.
-    unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? IPC::SpinRunLoopWhileWaitingForReply : 0;
+    unsigned syncSendFlags = WebPage::synchronousMessagesShouldSpinRunLoop() ? IPC::SpinRunLoopWhileWaitingForReply : 0;
     WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
 }
 
@@ -369,7 +369,7 @@
     m_page->injectedBundleUIClient().willRunJavaScriptConfirm(m_page, message, webFrame);
 
     // FIXME (126021): It is not good to change IPC behavior conditionally, and SpinRunLoopWhileWaitingForReply was known to cause trouble in other similar cases.
-    unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? IPC::SpinRunLoopWhileWaitingForReply : 0;
+    unsigned syncSendFlags = WebPage::synchronousMessagesShouldSpinRunLoop() ? IPC::SpinRunLoopWhileWaitingForReply : 0;
     bool result = false;
     if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
         return false;
@@ -386,7 +386,7 @@
     m_page->injectedBundleUIClient().willRunJavaScriptPrompt(m_page, message, defaultValue, webFrame);
 
     // FIXME (126021): It is not good to change IPC behavior conditionally, and SpinRunLoopWhileWaitingForReply was known to cause trouble in other similar cases.
-    unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? IPC::SpinRunLoopWhileWaitingForReply : 0;
+    unsigned syncSendFlags = WebPage::synchronousMessagesShouldSpinRunLoop() ? IPC::SpinRunLoopWhileWaitingForReply : 0;
     if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
         return false;
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (166768 => 166769)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2014-04-04 06:26:54 UTC (rev 166768)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2014-04-04 06:52:22 UTC (rev 166769)
@@ -655,7 +655,7 @@
 
     // Notify the UIProcess.
     // FIXME (126021): It is not good to change IPC behavior conditionally, and SpinRunLoopWhileWaitingForReply was known to cause trouble in other similar cases.
-    unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? IPC::SpinRunLoopWhileWaitingForReply : 0;
+    unsigned syncSendFlags = WebPage::synchronousMessagesShouldSpinRunLoop() ? IPC::SpinRunLoopWhileWaitingForReply : 0;
     if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), response, request, canShowMIMEType, listenerID, InjectedBundleUserMessageEncoder(userData.get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), std::chrono::milliseconds::max(), syncSendFlags))
         return;
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (166768 => 166769)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-04-04 06:26:54 UTC (rev 166768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-04-04 06:52:22 UTC (rev 166769)
@@ -4532,6 +4532,14 @@
     // That fits with AppKit's idea of an input context.
     return TextIterator::rangeFromLocationAndLength(frame.selection().rootEditableElementOrDocumentElement(), static_cast<int>(range.location), length);
 }
+    
+bool WebPage::synchronousMessagesShouldSpinRunLoop()
+{
+#if PLATFORM(MAC)
+    return WebCore::AXObjectCache::accessibilityEnabled();
+#endif
+    return false;
+}
+    
 
-
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (166768 => 166769)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-04-04 06:26:54 UTC (rev 166768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-04-04 06:52:22 UTC (rev 166769)
@@ -765,7 +765,11 @@
 #if ENABLE(IMAGE_CONTROLS)
     void replaceControlledImage(const ShareableBitmap::Handle&);
 #endif
-
+    
+    // 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();
+    
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to