Diff
Modified: tags/Safari-538.27.1/Source/WebKit2/ChangeLog (166771 => 166772)
--- tags/Safari-538.27.1/Source/WebKit2/ChangeLog 2014-04-04 07:10:05 UTC (rev 166771)
+++ tags/Safari-538.27.1/Source/WebKit2/ChangeLog 2014-04-04 07:18:19 UTC (rev 166772)
@@ -1,3 +1,27 @@
+2014-04-04 Babak Shafiei <[email protected]>
+
+ Merge r166769
+
+ 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-02 Tim Horton <[email protected]>
Remove a FIXME that happened.
Modified: tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (166771 => 166772)
--- tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2014-04-04 07:10:05 UTC (rev 166771)
+++ tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2014-04-04 07:18:19 UTC (rev 166772)
@@ -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: tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (166771 => 166772)
--- tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2014-04-04 07:10:05 UTC (rev 166771)
+++ tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2014-04-04 07:18:19 UTC (rev 166772)
@@ -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: tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (166771 => 166772)
--- tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-04-04 07:10:05 UTC (rev 166771)
+++ tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-04-04 07:18:19 UTC (rev 166772)
@@ -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: tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.h (166771 => 166772)
--- tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.h 2014-04-04 07:10:05 UTC (rev 166771)
+++ tags/Safari-538.27.1/Source/WebKit2/WebProcess/WebPage/WebPage.h 2014-04-04 07:18:19 UTC (rev 166772)
@@ -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&);