- Revision
- 195038
- Author
- carlo...@webkit.org
- Date
- 2016-01-14 04:23:19 -0800 (Thu, 14 Jan 2016)
Log Message
Merge r192702 - 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.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog 2016-01-14 12:23:19 UTC (rev 195038)
@@ -1,3 +1,34 @@
+2015-11-20 Geoffrey Garen <gga...@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-17 Geoffrey Garen <gga...@apple.com>
A window with a hung tab waits 5s before closing
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebPageProxy.cpp (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-01-14 12:23:19 UTC (rev 195038)
@@ -1800,8 +1800,6 @@
void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
{
- m_process->responsivenessTimer()->start();
-
if (m_shouldSendEventsSynchronously) {
bool handled = false;
m_process->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
@@ -1818,6 +1816,8 @@
rubberBandsAtTop(),
rubberBandsAtBottom()
), 0);
+
+ m_process->sendMainThreadPing();
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
@@ -4601,6 +4601,7 @@
switch (type) {
case WebEvent::NoType:
case WebEvent::MouseMove:
+ case WebEvent::Wheel:
break;
case WebEvent::MouseDown:
@@ -4608,7 +4609,6 @@
case WebEvent::MouseForceChanged:
case WebEvent::MouseForceDown:
case WebEvent::MouseForceUp:
- case WebEvent::Wheel:
case WebEvent::KeyDown:
case WebEvent::KeyUp:
case WebEvent::RawKeyDown:
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.cpp (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2016-01-14 12:23:19 UTC (rev 195038)
@@ -985,4 +985,15 @@
m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
}
+void WebProcessProxy::sendMainThreadPing()
+{
+ responsivenessTimer()->start();
+ send(Messages::WebProcess::MainThreadPing(), 0);
+}
+
+void WebProcessProxy::didReceiveMainThreadPing()
+{
+ responsivenessTimer()->stop();
+}
+
} // namespace WebKit
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.h (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.h 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.h 2016-01-14 12:23:19 UTC (rev 195038)
@@ -156,6 +156,9 @@
void reinstateNetworkProcessAssertionState(NetworkProcessProxy&);
#endif
+ void sendMainThreadPing();
+ void didReceiveMainThreadPing();
+
private:
explicit WebProcessProxy(WebProcessPool&);
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.messages.in (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.messages.in 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/WebProcessProxy.messages.in 2016-01-14 12:23:19 UTC (rev 195038)
@@ -51,4 +51,6 @@
RetainIconForPageURL(String pageURL)
ReleaseIconForPageURL(String pageURL)
+
+ DidReceiveMainThreadPing()
}
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.cpp (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.cpp 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.cpp 2016-01-14 12:23:19 UTC (rev 195038)
@@ -991,6 +991,11 @@
GCController::singleton().garbageCollectNow();
}
+void WebProcess::mainThreadPing()
+{
+ parentProcessConnection()->send(Messages::WebProcessProxy::DidReceiveMainThreadPing(), 0);
+}
+
void WebProcess::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
{
GCController::singleton().setJavaScriptGarbageCollectorTimerEnabled(flag);
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.h (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.h 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.h 2016-01-14 12:23:19 UTC (rev 195038)
@@ -272,6 +272,8 @@
void garbageCollectJavaScriptObjects();
void setJavaScriptGarbageCollectorTimerEnabled(bool flag);
+ void mainThreadPing();
+
void releasePageCache();
void fetchWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, uint64_t callbackID);
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.messages.in (195037 => 195038)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.messages.in 2016-01-14 12:14:19 UTC (rev 195037)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebProcess.messages.in 2016-01-14 12:23:19 UTC (rev 195038)
@@ -104,4 +104,6 @@
PrepareToSuspend()
CancelPrepareToSuspend()
ProcessDidResume()
+
+ MainThreadPing()
}