Changeset 84318 in webkit


Ignore:
Timestamp:
Apr 19, 2011 5:00:34 PM (13 years ago)
Author:
andersca@apple.com
Message:

2011-04-19 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

UI process thinks the page is unresponsive when a plug-in is showing a context menu
https://bugs.webkit.org/show_bug.cgi?id=58943
<rdar://problem/9299901>

Change the HandleMouseEvent message to have a delayed reply and make the PluginControllerProxy
respond to it immediately, before even passing the event to the plug-in. Since it doesn't matter
for mouse events whether the plug-in handled them or not we can do this.

Another solution could have been to make handleMouseEvent an asynchronous message, but that could
mess up the message ordering so this seemed like the least intrusive change.

  • PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::handleMouseEvent):
  • PluginProcess/PluginControllerProxy.h:
  • PluginProcess/PluginControllerProxy.messages.in:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r84304 r84318  
     12011-04-19  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        UI process thinks the page is unresponsive when a plug-in is showing a context menu
     6        https://bugs.webkit.org/show_bug.cgi?id=58943
     7        <rdar://problem/9299901>
     8
     9        Change the HandleMouseEvent message to have a delayed reply and make the PluginControllerProxy
     10        respond to it immediately, before even passing the event to the plug-in. Since it doesn't matter
     11        for mouse events whether the plug-in handled them or not we can do this.
     12
     13        Another solution could have been to make handleMouseEvent an asynchronous message, but that could
     14        mess up the message ordering so this seemed like the least intrusive change.
     15
     16        * PluginProcess/PluginControllerProxy.cpp:
     17        (WebKit::PluginControllerProxy::handleMouseEvent):
     18        * PluginProcess/PluginControllerProxy.h:
     19        * PluginProcess/PluginControllerProxy.messages.in:
     20
    1212011-04-19  Anders Carlsson  <andersca@apple.com>
    222
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r83842 r84318  
    437437}
    438438   
    439 void PluginControllerProxy::handleMouseEvent(const WebMouseEvent& mouseEvent, bool& handled)
    440 {
    441     handled = m_plugin->handleMouseEvent(mouseEvent);
     439void PluginControllerProxy::handleMouseEvent(const WebMouseEvent& mouseEvent, PassRefPtr<Messages::PluginControllerProxy::HandleMouseEvent::DelayedReply> reply)
     440{
     441    // Always let the web process think that we've handled this mouse event, even before passing it along to the plug-in.
     442    // This is a workaround for
     443    // <rdar://problem/9299901> UI process thinks the page is unresponsive when a plug-in is showing a context menu.
     444    // The web process sends a synchronous HandleMouseEvent message and the plug-in process spawns a nested
     445    // run loop when showing the context menu, so eventually the unresponsiveness timer kicks in in the UI process.
     446    // FIXME: We should come up with a better way to do this.
     447    reply->send(true);
     448
     449    m_plugin->handleMouseEvent(mouseEvent);
    442450}
    443451
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r83624 r84318  
    3232#include "Plugin.h"
    3333#include "PluginController.h"
     34#include "PluginControllerProxyMessages.h"
    3435#include "RunLoop.h"
    3536#include "ShareableBitmap.h"
     
    116117    void manualStreamDidFinishLoading();
    117118    void manualStreamDidFail(bool wasCancelled);
    118     void handleMouseEvent(const WebMouseEvent&, bool& handled);
     119    void handleMouseEvent(const WebMouseEvent&, PassRefPtr<Messages::PluginControllerProxy::HandleMouseEvent::DelayedReply>);
    119120    void handleWheelEvent(const WebWheelEvent&, bool& handled);
    120121    void handleMouseEnterEvent(const WebMouseEvent&, bool& handled);
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in

    r83842 r84318  
    6161
    6262    # Sent when a mouse event (that isn't a mouse enter/leave event or a wheel event) should be processed.
    63     HandleMouseEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled)
     63    HandleMouseEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled) Delayed
    6464   
    6565    # Sent when a mouse wheel event should be processed.
Note: See TracChangeset for help on using the changeset viewer.