[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 13:55:05 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9e127e430330c74b3d80135eebf3ba4e880147ed
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 29 17:23:01 2010 +0000

    Implement more PluginProxy member functions
    https://bugs.webkit.org/show_bug.cgi?id=46815
    
    Reviewed by Sam Weinig.
    
    * Platform/CoreIPC/HandleMessage.h:
    (CoreIPC::handleMessage):
    * PluginProcess/PluginControllerProxy.cpp:
    (WebKit::PluginControllerProxy::handleMouseEvent):
    (WebKit::PluginControllerProxy::handleWheelEvent):
    (WebKit::PluginControllerProxy::handleMouseEnterEvent):
    (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
    (WebKit::PluginControllerProxy::setFocus):
    (WebKit::PluginControllerProxy::windowFocusChanged):
    (WebKit::PluginControllerProxy::windowFrameChanged):
    (WebKit::PluginControllerProxy::windowVisibilityChanged):
    Call the appropriate Plugin member functions.
    
    * PluginProcess/PluginControllerProxy.messages.in:
    Add new messages.
    
    * PluginProcess/WebProcessConnection.cpp:
    (WebKit::WebProcessConnection::didReceiveMessage):
    It's OK to get a message for a plug-in controller proxy that has gone away.
    
    (WebKit::WebProcessConnection::didReceiveSyncMessage):
    Forward the message to the PluginControllerProxy handler.
    
    * WebProcess/Plugins/PluginProxy.cpp:
    (WebKit::PluginProxy::handleMouseEvent):
    (WebKit::PluginProxy::handleWheelEvent):
    (WebKit::PluginProxy::handleMouseEnterEvent):
    (WebKit::PluginProxy::handleMouseLeaveEvent):
    (WebKit::PluginProxy::setFocus):
    (WebKit::PluginProxy::windowFocusChanged):
    (WebKit::PluginProxy::windowFrameChanged):
    (WebKit::PluginProxy::windowVisibilityChanged):
    Send messages to the plug-in process.
    
    (WebKit::PluginProxy::controller):
    Return the plug-in controller.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68659 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index b2cf3b1..49fbfb2 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -20864,6 +20864,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
 			compatibilityVersion = "Xcode 2.4";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 443d67a..89a3832 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,47 @@
+2010-09-29  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement more PluginProxy member functions
+        https://bugs.webkit.org/show_bug.cgi?id=46815
+
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::handleMessage):
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::handleMouseEvent):
+        (WebKit::PluginControllerProxy::handleWheelEvent):
+        (WebKit::PluginControllerProxy::handleMouseEnterEvent):
+        (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
+        (WebKit::PluginControllerProxy::setFocus):
+        (WebKit::PluginControllerProxy::windowFocusChanged):
+        (WebKit::PluginControllerProxy::windowFrameChanged):
+        (WebKit::PluginControllerProxy::windowVisibilityChanged):
+        Call the appropriate Plugin member functions.
+
+        * PluginProcess/PluginControllerProxy.messages.in:
+        Add new messages.
+
+        * PluginProcess/WebProcessConnection.cpp:
+        (WebKit::WebProcessConnection::didReceiveMessage):
+        It's OK to get a message for a plug-in controller proxy that has gone away.
+
+        (WebKit::WebProcessConnection::didReceiveSyncMessage):
+        Forward the message to the PluginControllerProxy handler.
+
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::handleMouseEvent):
+        (WebKit::PluginProxy::handleWheelEvent):
+        (WebKit::PluginProxy::handleMouseEnterEvent):
+        (WebKit::PluginProxy::handleMouseLeaveEvent):
+        (WebKit::PluginProxy::setFocus):
+        (WebKit::PluginProxy::windowFocusChanged):
+        (WebKit::PluginProxy::windowFrameChanged):
+        (WebKit::PluginProxy::windowVisibilityChanged):
+        Send messages to the plug-in process.
+        
+        (WebKit::PluginProxy::controller):
+        Return the plug-in controller.
+
 2010-09-29  Adam Roben  <aroben at apple.com>
 
         Look for WebKit.dll (not WebKit_debug.dll) when launching the web
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 8209dbd..70e6c57 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -58,6 +58,18 @@ void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object
     (object->*function)(firstArgument);
 }
 
+template<typename T, typename C, typename P1, typename R1>
+void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1, R1&))
+{
+    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
+    if (!arguments->decode(firstArgument))
+        return;
+
+    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
+    (object->*function)(firstArgument, firstReplyArgument);
+    reply->encode(firstReplyArgument);
+}
+
 template<typename T, typename C, typename P1, typename P2, typename R1>
 void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1, P2, R1&))
 {
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index f1a127c..562d09c 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -194,6 +194,48 @@ void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const In
     m_plugin->geometryDidChange(frameRect, clipRect);
 }
 
+void PluginControllerProxy::handleMouseEvent(const WebMouseEvent& mouseEvent, bool& handled)
+{
+    handled = m_plugin->handleMouseEvent(mouseEvent);
+}
+
+void PluginControllerProxy::handleWheelEvent(const WebWheelEvent& wheelEvent, bool& handled)
+{
+    handled = m_plugin->handleWheelEvent(wheelEvent);
+}
+
+void PluginControllerProxy::handleMouseEnterEvent(const WebMouseEvent& mouseEnterEvent, bool& handled)
+{
+    handled = m_plugin->handleMouseEnterEvent(mouseEnterEvent);
+}
+
+void PluginControllerProxy::handleMouseLeaveEvent(const WebMouseEvent& mouseLeaveEvent, bool& handled)
+{
+    handled = m_plugin->handleMouseLeaveEvent(mouseLeaveEvent);
+}
+    
+void PluginControllerProxy::setFocus(bool hasFocus)
+{
+    m_plugin->setFocus(hasFocus);
+}
+
+#if PLATFORM(MAC)
+void PluginControllerProxy::windowFocusChanged(bool hasFocus)
+{
+    m_plugin->windowFocusChanged(hasFocus);
+}
+
+void PluginControllerProxy::windowFrameChanged(const IntRect& windowFrame)
+{
+    m_plugin->windowFrameChanged(windowFrame);
+}
+
+void PluginControllerProxy::windowVisibilityChanged(bool isVisible)
+{
+    m_plugin->windowVisibilityChanged(isVisible);
+}
+#endif
+
 } // namespace WebKit
 
 #endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index 7946380..4c1c8f1 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -53,6 +53,7 @@ public:
     void destroy();
 
     void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    CoreIPC::SyncReplyMode didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
 
 private:
     PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID);
@@ -74,6 +75,16 @@ private:
 
     // Message handlers.
     void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle);
+    void handleMouseEvent(const WebMouseEvent&, bool& handled);
+    void handleWheelEvent(const WebWheelEvent&, bool& handled);
+    void handleMouseEnterEvent(const WebMouseEvent&, bool& handled);
+    void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
+    void setFocus(bool);
+#if PLATFORM(MAC)
+    void windowFocusChanged(bool);
+    void windowFrameChanged(const WebCore::IntRect&);
+    void windowVisibilityChanged(bool);
+#endif
 
     WebProcessConnection* m_connection;
     uint64_t m_pluginInstanceID;
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
index 9f11fb9..30333eb 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.messages.in
+++ b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -23,8 +23,34 @@
 #if ENABLE(PLUGIN_PROCESS)
 
 messages -> PluginControllerProxy {
-    # Called when the plug-in geometry changes.
+    # Sent when the plug-in geometry changes.
     GeometryDidChange(WebCore::IntRect frameRect, WebCore::IntRect clipRect, WebKit::SharedMemory::Handle backingStoreHandle)
+
+    # Sent when a mouse event (that isn't a mouse enter/leave event or a wheel event) should be processed.
+    HandleMouseEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled)
+    
+    # Sent when a mouse wheel event should be processed.
+    HandleWheelEvent(WebKit::WebWheelEvent wheelEvent) -> (bool handled)
+
+    # Sent when a mouse enter event should be processed.
+    HandleMouseEnterEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled)
+    
+    # Sent when a mouse leave event should be processed.
+    HandleMouseLeaveEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled)
+
+    # Sent when the plug-in focus changes.
+    SetFocus(bool isFocused)
+
+#if PLATFORM(MAC)
+    # Sent when the containing NSWindow's focus changes
+    WindowFocusChanged(bool hasFocus)
+
+    # Sent when the containing NSWindow's frame changes
+    WindowFrameChanged(WebCore::IntRect windowFrame)
+
+    # Sent when the containing NSWindow's visibility changes
+    WindowVisibilityChanged(bool isVisible)
+#endif
 }
 
 #endif
diff --git a/WebKit2/PluginProcess/WebProcessConnection.cpp b/WebKit2/PluginProcess/WebProcessConnection.cpp
index fbbdb45..c8d2b59 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -87,13 +87,24 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
 
 void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
-    PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
-    pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
+    if (!arguments->destinationID()) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    
+    if (PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID()))
+        pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
 }
 
 CoreIPC::SyncReplyMode WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
 {
-    return didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
+    if (!arguments->destinationID())
+        return didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
+    
+    if (PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID()))
+        return pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
+
+    return CoreIPC::AutomaticReply;
 }
 
 void WebProcessConnection::didClose(CoreIPC::Connection*)
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index ec5aa08..8295fff 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -548,8 +548,8 @@
 		1A8EF4C91252403700F7067F /* PluginControllerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginControllerProxy.h; sourceTree = "<group>"; };
 		1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginControllerProxy.cpp; sourceTree = "<group>"; };
 		1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginControllerProxy.messages.in; sourceTree = "<group>"; };
-		1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginControllerProxyMessageReceiver.cpp; path = ../../../Debug/DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
-		1A8EF96D1252AF6B00F7067F /* PluginControllerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginControllerProxyMessages.h; path = ../../../Debug/DerivedSources/WebKit2/PluginControllerProxyMessages.h; sourceTree = "<group>"; };
+		1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginControllerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+		1A8EF96D1252AF6B00F7067F /* PluginControllerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginControllerProxyMessages.h; sourceTree = "<group>"; };
 		1A8EFA5B1252B7CE00F7067F /* PluginProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginProxy.messages.in; sourceTree = "<group>"; };
 		1A8EFA6E1252B84100F7067F /* PluginProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		1A8EFA6F1252B84100F7067F /* PluginProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProxyMessages.h; sourceTree = "<group>"; };
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 0e9e8a2..82e5e7c 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -33,6 +33,7 @@
 #include "PluginControllerProxyMessages.h"
 #include "PluginProcessConnection.h"
 #include "WebCoreArgumentCoders.h"
+#include "WebEvent.h"
 #include "WebProcessConnectionMessages.h"
 #include <WebCore/GraphicsContext.h>
 
@@ -221,33 +222,53 @@ void PluginProxy::manualStreamDidFail(bool wasCancelled)
     notImplemented();
 }
 
-bool PluginProxy::handleMouseEvent(const WebMouseEvent&)
+bool PluginProxy::handleMouseEvent(const WebMouseEvent& mouseEvent)
 {
-    notImplemented();
-    return false;
+    bool handled = false;
+    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseEvent(mouseEvent),
+                                              Messages::PluginControllerProxy::HandleMouseEvent::Reply(handled),
+                                              m_pluginInstanceID, CoreIPC::Connection::NoTimeout))
+        return false;
+
+    return handled;
 }
 
-bool PluginProxy::handleWheelEvent(const WebWheelEvent&)
+bool PluginProxy::handleWheelEvent(const WebWheelEvent& wheelEvent)
 {
-    notImplemented();
-    return false;
+    bool handled = false;
+    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleWheelEvent(wheelEvent),
+                                              Messages::PluginControllerProxy::HandleWheelEvent::Reply(handled),
+                                              m_pluginInstanceID, CoreIPC::Connection::NoTimeout))
+        return false;
+
+    return handled;
 }
 
-bool PluginProxy::handleMouseEnterEvent(const WebMouseEvent&)
+bool PluginProxy::handleMouseEnterEvent(const WebMouseEvent& mouseEnterEvent)
 {
-    notImplemented();
-    return false;
+    bool handled = false;
+    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseEnterEvent(mouseEnterEvent),
+                                              Messages::PluginControllerProxy::HandleMouseEnterEvent::Reply(handled),
+                                              m_pluginInstanceID, CoreIPC::Connection::NoTimeout))
+        return false;
+    
+    return handled;
 }
 
-bool PluginProxy::handleMouseLeaveEvent(const WebMouseEvent&)
+bool PluginProxy::handleMouseLeaveEvent(const WebMouseEvent& mouseLeaveEvent)
 {
-    notImplemented();
-    return false;
+    bool handled = false;
+    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleMouseLeaveEvent(mouseLeaveEvent),
+                                              Messages::PluginControllerProxy::HandleMouseLeaveEvent::Reply(handled),
+                                              m_pluginInstanceID, CoreIPC::Connection::NoTimeout))
+        return false;
+    
+    return handled;
 }
 
-void PluginProxy::setFocus(bool)
+void PluginProxy::setFocus(bool hasFocus)
 {
-    notImplemented();
+    m_connection->connection()->send(Messages::PluginControllerProxy::SetFocus(hasFocus), m_pluginInstanceID);
 }
 
 NPObject* PluginProxy::pluginScriptableNPObject()
@@ -257,27 +278,26 @@ NPObject* PluginProxy::pluginScriptableNPObject()
 }
 
 #if PLATFORM(MAC)
-void PluginProxy::windowFocusChanged(bool)
+void PluginProxy::windowFocusChanged(bool hasFocus)
 {
-    notImplemented();
+    m_connection->connection()->send(Messages::PluginControllerProxy::WindowFocusChanged(hasFocus), m_pluginInstanceID);
 }
 
-void PluginProxy::windowFrameChanged(const IntRect&)
+void PluginProxy::windowFrameChanged(const IntRect& windowFrame)
 {
+    m_connection->connection()->send(Messages::PluginControllerProxy::WindowFrameChanged(windowFrame), m_pluginInstanceID);
     notImplemented();
 }
 
-void PluginProxy::windowVisibilityChanged(bool)
+void PluginProxy::windowVisibilityChanged(bool isVisible)
 {
-    notImplemented();
+    m_connection->connection()->send(Messages::PluginControllerProxy::WindowVisibilityChanged(isVisible), m_pluginInstanceID);
 }
-
 #endif
 
 PluginController* PluginProxy::controller()
 {
-    notImplemented();
-    return 0;
+    return m_pluginController;
 }
 
 void PluginProxy::update(const IntRect& paintedRect)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list