Changeset 194330 in webkit
- Timestamp:
- Dec 21, 2015 7:16:58 AM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r194325 r194330 1 2015-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 1 33 2015-12-20 Joonghun Park <jh718.park@samsung.com> 2 34 -
trunk/Source/WebKit2/Platform/IPC/Connection.cpp
r189546 r194330 583 583 // This allows the WebProcess to still serve clients while waiting for the message to return. 584 584 // 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 597 588 didReceiveSyncReply(syncSendFlags); 598 589 -
trunk/Source/WebKit2/Platform/IPC/Connection.h
r191881 r194330 70 70 // Use this to inform that this sync call will suspend this process until the user responds with input. 71 71 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, 76 73 }; 77 74 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r194108 r194330 342 342 HangDetectionDisabler hangDetectionDisabler; 343 343 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)) 349 345 return false; 350 346 … … 381 377 HangDetectionDisabler hangDetectionDisabler; 382 378 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); 387 380 } 388 381 … … 397 390 HangDetectionDisabler hangDetectionDisabler; 398 391 399 unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;400 if (WebPage::synchronousMessagesShouldSpinRunLoop())401 syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;402 392 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)) 404 394 return false; 405 395 … … 417 407 HangDetectionDisabler hangDetectionDisabler; 418 408 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)) 424 410 return false; 425 411 … … 645 631 #endif 646 632 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); 652 634 } 653 635 … … 667 649 668 650 if (!newQuota) { 669 unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;670 if (WebPage::synchronousMessagesShouldSpinRunLoop())671 syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;672 673 651 WebProcess::singleton().parentProcessConnection()->sendSync( 674 652 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); 676 654 } 677 655 … … 689 667 if (m_page->injectedBundleUIClient().didReachApplicationCacheOriginQuota(m_page, securityOrigin.get(), totalBytesNeeded)) 690 668 return; 691 692 unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;693 if (WebPage::synchronousMessagesShouldSpinRunLoop())694 syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;695 669 696 670 auto& cacheStorage = ApplicationCacheStorage::singleton(); … … 702 676 WebProcess::singleton().parentProcessConnection()->sendSync( 703 677 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); 705 679 706 680 cacheStorage.storeUpdatedQuotaForOrigin(origin, newQuota); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r194264 r194330 697 697 DownloadID downloadID; 698 698 699 unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;700 if (WebPage::synchronousMessagesShouldSpinRunLoop())701 syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;702 703 699 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)) { 705 701 m_frame->didReceivePolicyDecision(listenerID, PolicyIgnore, 0, { }); 706 702 return; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r194318 r194330 5008 5008 } 5009 5009 5010 bool WebPage::synchronousMessagesShouldSpinRunLoop()5011 {5012 return false;5013 }5014 5015 5010 void WebPage::didChangeScrollOffsetForFrame(Frame* frame) 5016 5011 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r194274 r194330 882 882 void getBytecodeProfile(uint64_t callbackID); 883 883 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 888 884 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) 889 885 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
Note: See TracChangeset
for help on using the changeset viewer.