https://bugs.webkit.org/show_bug.cgi?id=151518
Reviewed by Sam Weinig.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::didReceiveEvent): Don't treat wheel events as
starting or stopping the responsiveness timer. Wheel events usually
process on the event dispatch thread, which responds even if the main
thread is hung.
Instead, send an out-of-band ping to the main thread to verify that
it is still responsive and we'll be able to paint and respond to clicks
after scrolling.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendMainThreadPing):
(WebKit::WebProcessProxy::didReceiveMainThreadPing):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in: UI process support for pinging
the main thread in the web process.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::mainThreadPing):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in: Web process support for responding
to pings.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192702
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-11-20 Geoffrey Garen <ggaren@apple.com>
+
+ A hung webpage pretends to be responsive if you scroll
+ https://bugs.webkit.org/show_bug.cgi?id=151518
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::sendWheelEvent):
+ (WebKit::WebPageProxy::didReceiveEvent): Don't treat wheel events as
+ starting or stopping the responsiveness timer. Wheel events usually
+ process on the event dispatch thread, which responds even if the main
+ thread is hung.
+
+ Instead, send an out-of-band ping to the main thread to verify that
+ it is still responsive and we'll be able to paint and respond to clicks
+ after scrolling.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::sendMainThreadPing):
+ (WebKit::WebProcessProxy::didReceiveMainThreadPing):
+ * UIProcess/WebProcessProxy.h:
+ * UIProcess/WebProcessProxy.messages.in: UI process support for pinging
+ the main thread in the web process.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::mainThreadPing):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in: Web process support for responding
+ to pings.
+
2015-11-20 Simon Fraser <simon.fraser@apple.com>
Allow more buffer formats in the IOSurface pool
void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
{
- m_process->responsivenessTimer().start();
-
m_process->send(
Messages::EventDispatcher::WheelEvent(
m_pageID,
rubberBandsAtTop(),
rubberBandsAtBottom()
), 0);
+
+ m_process->sendMainThreadPing();
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
switch (type) {
case WebEvent::NoType:
case WebEvent::MouseMove:
+ case WebEvent::Wheel:
break;
case WebEvent::MouseDown:
case WebEvent::MouseForceChanged:
case WebEvent::MouseForceDown:
case WebEvent::MouseForceUp:
- case WebEvent::Wheel:
case WebEvent::KeyDown:
case WebEvent::KeyUp:
case WebEvent::RawKeyDown:
m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
}
+void WebProcessProxy::sendMainThreadPing()
+{
+ responsivenessTimer().start();
+ send(Messages::WebProcess::MainThreadPing(), 0);
+}
+
+void WebProcessProxy::didReceiveMainThreadPing()
+{
+ responsivenessTimer().stop();
+}
+
} // namespace WebKit
void reinstateNetworkProcessAssertionState(NetworkProcessProxy&);
+ void sendMainThreadPing();
+ void didReceiveMainThreadPing();
+
private:
explicit WebProcessProxy(WebProcessPool&);
RetainIconForPageURL(String pageURL)
ReleaseIconForPageURL(String pageURL)
+
+ DidReceiveMainThreadPing()
}
GCController::singleton().garbageCollectNow();
}
+void WebProcess::mainThreadPing()
+{
+ parentProcessConnection()->send(Messages::WebProcessProxy::DidReceiveMainThreadPing(), 0);
+}
+
void WebProcess::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
{
GCController::singleton().setJavaScriptGarbageCollectorTimerEnabled(flag);
void garbageCollectJavaScriptObjects();
void setJavaScriptGarbageCollectorTimerEnabled(bool flag);
+ void mainThreadPing();
+
void releasePageCache();
void fetchWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, uint64_t callbackID);
PrepareToSuspend()
CancelPrepareToSuspend()
ProcessDidResume()
+
+ MainThreadPing()
}