Title: [147253] trunk/Source/WebKit2
Revision
147253
Author
beid...@apple.com
Date
2013-03-29 14:56:45 -0700 (Fri, 29 Mar 2013)

Log Message

Should never send events to plugins waiting on asynchronous initialization.
<rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612

Reviewed by Anders Carlsson.

Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.

A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::handleMouseEvent):
(WebKit::PluginProxy::handleWheelEvent):
(WebKit::PluginProxy::handleMouseEnterEvent):
(WebKit::PluginProxy::handleMouseLeaveEvent):
(WebKit::PluginProxy::handleKeyboardEvent):
(WebKit::PluginProxy::handleEditingCommand):
(WebKit::PluginProxy::isEditingCommandEnabled):
(WebKit::PluginProxy::handlesPageScaleFactor):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (147252 => 147253)


--- trunk/Source/WebKit2/ChangeLog	2013-03-29 21:37:04 UTC (rev 147252)
+++ trunk/Source/WebKit2/ChangeLog	2013-03-29 21:56:45 UTC (rev 147253)
@@ -1,5 +1,26 @@
 2013-03-29  Brady Eidson  <beid...@apple.com>
 
+        Should never send events to plugins waiting on asynchronous initialization.
+        <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
+
+        Reviewed by Anders Carlsson.
+
+        Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
+
+        A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
+
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::handleMouseEvent):
+        (WebKit::PluginProxy::handleWheelEvent):
+        (WebKit::PluginProxy::handleMouseEnterEvent):
+        (WebKit::PluginProxy::handleMouseLeaveEvent):
+        (WebKit::PluginProxy::handleKeyboardEvent):
+        (WebKit::PluginProxy::handleEditingCommand):
+        (WebKit::PluginProxy::isEditingCommandEnabled):
+        (WebKit::PluginProxy::handlesPageScaleFactor):
+
+2013-03-29  Brady Eidson  <beid...@apple.com>
+
         "Empty cache..." clears the disk cache from each WebProcess.
         <rdar://problem/12456652> and https://bugs.webkit.org/show_bug.cgi?id=113603
 

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (147252 => 147253)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2013-03-29 21:37:04 UTC (rev 147252)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2013-03-29 21:56:45 UTC (rev 147253)
@@ -354,6 +354,9 @@
 
 bool PluginProxy::handleMouseEvent(const WebMouseEvent& mouseEvent)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseEvent(mouseEvent), Messages::PluginControllerProxy::HandleMouseEvent::Reply(handled), m_pluginInstanceID))
         return false;
@@ -363,6 +366,9 @@
 
 bool PluginProxy::handleWheelEvent(const WebWheelEvent& wheelEvent)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleWheelEvent(wheelEvent), Messages::PluginControllerProxy::HandleWheelEvent::Reply(handled), m_pluginInstanceID))
         return false;
@@ -372,6 +378,9 @@
 
 bool PluginProxy::handleMouseEnterEvent(const WebMouseEvent& mouseEnterEvent)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseEnterEvent(mouseEnterEvent), Messages::PluginControllerProxy::HandleMouseEnterEvent::Reply(handled), m_pluginInstanceID))
         return false;
@@ -381,6 +390,9 @@
 
 bool PluginProxy::handleMouseLeaveEvent(const WebMouseEvent& mouseLeaveEvent)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseLeaveEvent(mouseLeaveEvent), Messages::PluginControllerProxy::HandleMouseLeaveEvent::Reply(handled), m_pluginInstanceID))
         return false;
@@ -396,6 +408,9 @@
 
 bool PluginProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboardEvent)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleKeyboardEvent(keyboardEvent), Messages::PluginControllerProxy::HandleKeyboardEvent::Reply(handled), m_pluginInstanceID))
         return false;
@@ -410,6 +425,9 @@
 
 bool PluginProxy::handleEditingCommand(const String& commandName, const String& argument)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleEditingCommand(commandName, argument), Messages::PluginControllerProxy::HandleEditingCommand::Reply(handled), m_pluginInstanceID))
         return false;
@@ -419,6 +437,9 @@
     
 bool PluginProxy::isEditingCommandEnabled(const String& commandName)
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool enabled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::IsEditingCommandEnabled(commandName), Messages::PluginControllerProxy::IsEditingCommandEnabled::Reply(enabled), m_pluginInstanceID))
         return false;
@@ -428,6 +449,9 @@
     
 bool PluginProxy::handlesPageScaleFactor()
 {
+    if (m_waitingOnAsynchronousInitialization)
+        return false;
+
     bool handled = false;
     if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandlesPageScaleFactor(), Messages::PluginControllerProxy::HandlesPageScaleFactor::Reply(handled), m_pluginInstanceID))
         return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to