Changeset 192702 in webkit


Ignore:
Timestamp:
Nov 20, 2015 3:10:02 PM (8 years ago)
Author:
ggaren@apple.com
Message:

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.

Location:
trunk/Source/WebKit2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r192701 r192702  
     12015-11-20  Geoffrey Garen  <ggaren@apple.com>
     2
     3        A hung webpage pretends to be responsive if you scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=151518
     5
     6        Reviewed by Sam Weinig.
     7
     8        * UIProcess/WebPageProxy.cpp:
     9        (WebKit::WebPageProxy::sendWheelEvent):
     10        (WebKit::WebPageProxy::didReceiveEvent): Don't treat wheel events as
     11        starting or stopping the responsiveness timer. Wheel events usually
     12        process on the event dispatch thread, which responds even if the main
     13        thread is hung.
     14
     15        Instead, send an out-of-band ping to the main thread to verify that
     16        it is still responsive and we'll be able to paint and respond to clicks
     17        after scrolling.
     18
     19        * UIProcess/WebProcessProxy.cpp:
     20        (WebKit::WebProcessProxy::sendMainThreadPing):
     21        (WebKit::WebProcessProxy::didReceiveMainThreadPing):
     22        * UIProcess/WebProcessProxy.h:
     23        * UIProcess/WebProcessProxy.messages.in: UI process support for pinging
     24        the main thread in the web process.
     25
     26        * WebProcess/WebProcess.cpp:
     27        (WebKit::WebProcess::mainThreadPing):
     28        * WebProcess/WebProcess.h:
     29        * WebProcess/WebProcess.messages.in: Web process support for responding
     30        to pings.
     31
    1322015-11-20  Simon Fraser  <simon.fraser@apple.com>
    233
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r192697 r192702  
    17981798void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
    17991799{
    1800     m_process->responsivenessTimer().start();
    1801 
    18021800    m_process->send(
    18031801        Messages::EventDispatcher::WheelEvent(
     
    18091807            rubberBandsAtBottom()
    18101808        ), 0);
     1809
     1810    m_process->sendMainThreadPing();
    18111811}
    18121812
     
    45014501    case WebEvent::NoType:
    45024502    case WebEvent::MouseMove:
     4503    case WebEvent::Wheel:
    45034504        break;
    45044505
     
    45084509    case WebEvent::MouseForceDown:
    45094510    case WebEvent::MouseForceUp:
    4510     case WebEvent::Wheel:
    45114511    case WebEvent::KeyDown:
    45124512    case WebEvent::KeyUp:
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r192697 r192702  
    10031003}
    10041004
     1005void WebProcessProxy::sendMainThreadPing()
     1006{
     1007    responsivenessTimer().start();
     1008    send(Messages::WebProcess::MainThreadPing(), 0);
     1009}
     1010
     1011void WebProcessProxy::didReceiveMainThreadPing()
     1012{
     1013    responsivenessTimer().stop();
     1014}
     1015
    10051016} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r192697 r192702  
    155155    void reinstateNetworkProcessAssertionState(NetworkProcessProxy&);
    156156
     157    void sendMainThreadPing();
     158    void didReceiveMainThreadPing();
     159
    157160private:
    158161    explicit WebProcessProxy(WebProcessPool&);
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in

    r192697 r192702  
    5050    RetainIconForPageURL(String pageURL)
    5151    ReleaseIconForPageURL(String pageURL)
     52
     53    DidReceiveMainThreadPing()
    5254}
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r192697 r192702  
    981981}
    982982
     983void WebProcess::mainThreadPing()
     984{
     985    parentProcessConnection()->send(Messages::WebProcessProxy::DidReceiveMainThreadPing(), 0);
     986}
     987
    983988void WebProcess::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
    984989{
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r192697 r192702  
    269269    void setJavaScriptGarbageCollectorTimerEnabled(bool flag);
    270270
     271    void mainThreadPing();
     272
    271273    void releasePageCache();
    272274
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r192673 r192702  
    106106    CancelPrepareToSuspend()
    107107    ProcessDidResume()
     108
     109    MainThreadPing()
    108110}
Note: See TracChangeset for help on using the changeset viewer.