Changeset 85502 in webkit


Ignore:
Timestamp:
May 2, 2011 12:24:26 PM (13 years ago)
Author:
jeffm@apple.com
Message:

2011-05-02 Jeff Miller <jeffm@apple.com>

Reviewed by Adam Roben.

WebKit2 thinks the web process is unresponsive when a plugin displays a context menu
https://bugs.webkit.org/show_bug.cgi?id=59124
<rdar://problem/9318600>


This is the Windows version of <https://bugs.webkit.org/show_bug.cgi?id=58943>.

Since we have no control over how long a plugin will take to handle an event, we need
to tell the UI process to stop its responsive timer when we're about to send an event
to the plugin. The downside of doing this is that if the plugin does become unresponsive,
the user won't know this immediately until they click on the web page again. At that point,
if the web process is unresponsive because of a hung plugin, the responsiveness timer will fire.


We're only doing this on Windows currently when running plugins in the web process (Anders fixed
bug 58943 in a different way when running plugins in a separate plugin process on the Mac).

  • PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::willSendEventToPlugin): Added, not used when running plugins in a separate process.
  • PluginProcess/PluginControllerProxy.h: Added willSendEventToPlugin().
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::stopResponsivenessTimer): Added.
  • UIProcess/WebPageProxy.h: Added stopResponsivenessTimer().
  • UIProcess/WebPageProxy.messages.in: Added StopResponsivenessTimer message.
  • WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp: (WebKit::NetscapePlugin::platformPaint): Tell our controller when we're about to send an event to the plugin. (WebKit::NetscapePlugin::platformHandleMouseEvent): Ditto. (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Ditto. (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Ditto.
  • WebProcess/Plugins/PluginController.h: Added willSendEventToPlugin().
  • WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::willSendEventToPlugin): Added, tell the UI process to stop its responsiveness timer.
  • WebProcess/Plugins/PluginView.h: Added willSendEventToPlugin().
Location:
trunk/Source/WebKit2
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85493 r85502  
     12011-05-02  Jeff Miller  <jeffm@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        WebKit2 thinks the web process is unresponsive when a plugin displays a context menu
     6        https://bugs.webkit.org/show_bug.cgi?id=59124
     7        <rdar://problem/9318600>
     8       
     9        This is the Windows version of <https://bugs.webkit.org/show_bug.cgi?id=58943>.
     10
     11        Since we have no control over how long a plugin will take to handle an event, we need
     12        to tell the UI process to stop its responsive timer when we're about to send an event
     13        to the plugin. The downside of doing this is that if the plugin does become unresponsive,
     14        the user won't know this immediately until they click on the web page again.  At that point,
     15        if the web process is unresponsive because of a hung plugin, the responsiveness timer will fire.
     16       
     17        We're only doing this on Windows currently when running plugins in the web process (Anders fixed
     18        bug 58943 in a different way when running plugins in a separate plugin process on the Mac).
     19
     20        * PluginProcess/PluginControllerProxy.cpp:
     21        (WebKit::PluginControllerProxy::willSendEventToPlugin): Added, not used when running plugins in a separate process.
     22        * PluginProcess/PluginControllerProxy.h: Added willSendEventToPlugin().
     23
     24        * UIProcess/WebPageProxy.cpp:
     25        (WebKit::WebPageProxy::stopResponsivenessTimer): Added.
     26        * UIProcess/WebPageProxy.h: Added stopResponsivenessTimer().
     27        * UIProcess/WebPageProxy.messages.in: Added StopResponsivenessTimer message.
     28
     29        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
     30        (WebKit::NetscapePlugin::platformPaint): Tell our controller when we're about to send an event to the plugin.
     31        (WebKit::NetscapePlugin::platformHandleMouseEvent): Ditto.
     32        (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Ditto.
     33        (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Ditto.
     34
     35        * WebProcess/Plugins/PluginController.h: Added willSendEventToPlugin().
     36        * WebProcess/Plugins/PluginView.cpp:
     37        (WebKit::PluginView::willSendEventToPlugin): Added, tell the UI process to stop its responsiveness timer.
     38        * WebProcess/Plugins/PluginView.h: Added willSendEventToPlugin().
     39
    1402011-04-29  Steve Falkenburg  <sfalken@apple.com>
    241
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r84318 r85502  
    294294}
    295295
     296void PluginControllerProxy::willSendEventToPlugin()
     297{
     298    // This is only used when running plugins in the web process.
     299    ASSERT_NOT_REACHED();
     300}
     301
    296302#if PLATFORM(MAC)
    297303void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r84318 r85502  
    9191    virtual bool isAcceleratedCompositingEnabled();
    9292    virtual void pluginProcessCrashed();
     93    virtual void willSendEventToPlugin();
    9394
    9495#if PLATFORM(MAC)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r85439 r85502  
    26522652}
    26532653
     2654void WebPageProxy::stopResponsivenessTimer()
     2655{
     2656    process()->responsivenessTimer()->stop();
     2657}
     2658
    26542659void WebPageProxy::voidCallback(uint64_t callbackID)
    26552660{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r85356 r85502  
    691691
    692692    void didReceiveEvent(uint32_t opaqueType, bool handled);
     693    void stopResponsivenessTimer();
    693694
    694695    void voidCallback(uint64_t);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r85120 r85502  
    3434    DidChangeViewportData(WebCore::ViewportArguments arguments)
    3535    DidReceiveEvent(uint32_t type, bool handled)
     36    StopResponsivenessTimer()
    3637    SetCursor(WebCore::Cursor cursor)
    3738    SetStatusText(WTF::String statusText)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp

    r84638 r85502  
    178178    }
    179179
     180    m_pluginController->willSendEventToPlugin();
     181   
    180182    // FIXME: Support transparent plugins.
    181183    LocalWindowsContext windowsContext(context, dirtyRect, false);
     
    285287        return false;
    286288
     289    m_pluginController->willSendEventToPlugin();
     290
    287291    NPEvent npEvent = toNP(event);
    288292    NPP_HandleEvent(&npEvent);
     
    312316        return false;
    313317
     318    m_pluginController->willSendEventToPlugin();
     319
    314320    NPEvent npEvent = toNP(event);
    315321    NPP_HandleEvent(&npEvent);
     
    323329    if (m_isWindowed)
    324330        return false;
     331
     332    m_pluginController->willSendEventToPlugin();
    325333
    326334    NPEvent npEvent = toNP(event);
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h

    r78915 r85502  
    8484    virtual void pluginProcessCrashed() = 0;
    8585   
     86    // Tells the controller that we're about to dispatch an event to the plug-in.
     87    virtual void willSendEventToPlugin() = 0;
     88   
    8689#if PLATFORM(WIN)
    8790    // The window to use as the parent of the plugin's window.
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r85442 r85502  
    991991}
    992992
     993void PluginView::willSendEventToPlugin()
     994{
     995    // If we're sending an event to a plug-in, we can't control how long the plug-in
     996    // takes to process it (e.g. it may display a context menu), so we tell the UI process
     997    // to stop the responsiveness timer in this case.
     998    m_webPage->send(Messages::WebPageProxy::StopResponsivenessTimer());
     999}
     1000
    9931001#if PLATFORM(WIN)
    9941002HWND PluginView::nativeParentWindow()
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h

    r79058 r85502  
    130130    virtual bool isAcceleratedCompositingEnabled();
    131131    virtual void pluginProcessCrashed();
     132    virtual void willSendEventToPlugin();
    132133#if PLATFORM(WIN)
    133134    virtual HWND nativeParentWindow();
Note: See TracChangeset for help on using the changeset viewer.