[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 14:04:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3cca6e3b2a595a3f2e38c93ca9907d3f3409a42a
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 3 21:50:13 2010 +0000

    Implement newly added Plugin/PluginController member functions for out of process plug-ins
    https://bugs.webkit.org/show_bug.cgi?id=47065
    <rdar://problem/8507194>
    
    Reviewed by Sam Weinig.
    
    * Platform/CoreIPC/Arguments.h:
    Add typedefs.
    
    * Platform/CoreIPC/HandleMessage.h:
    (CoreIPC::handleMessage):
    Add new handleMessage overload.
    
    * PluginProcess/PluginControllerProxy.cpp:
    (WebKit::PluginControllerProxy::create):
    Add an isPrivateBrowsingEnabled boolean.
    
    (WebKit::PluginControllerProxy::PluginControllerProxy):
    Add an isPrivateBrowsingEnabled boolean.
    
    (WebKit::PluginControllerProxy::proxiesForURL):
    (WebKit::PluginControllerProxy::cookiesForURL):
    (WebKit::PluginControllerProxy::setCookiesForURL):
    Send messages to the web process.
    
    (WebKit::PluginControllerProxy::isPrivateBrowsingEnabled):
    Return whether private browsing is enabled or not.
    
    (WebKit::PluginControllerProxy::handleKeyboardEvent):
    Call Plugin::handleKeyboardEvent.
    
    (WebKit::PluginControllerProxy::privateBrowsingStateChanged):
    Call Plugin::privateBrowsingStateChanged.
    
    * PluginProcess/PluginControllerProxy.messages.in:
    Add new messages.
    
    * PluginProcess/WebProcessConnection.cpp:
    (WebKit::WebProcessConnection::createPlugin):
    Pass the isPrivateBrowsingEnabled flag.
    
    * PluginProcess/WebProcessConnection.h:
    * PluginProcess/WebProcessConnection.messages.in:
    Update CreatePlugin message parameters.
    
    * WebProcess/Plugins/PluginProcessConnection.cpp:
    (WebKit::PluginProcessConnection::didReceiveMessage):
    (WebKit::PluginProcessConnection::didReceiveSyncMessage):
    It's OK for a plug-in to not get a sync message.
    
    * WebProcess/Plugins/PluginProcessConnection.h:
    * WebProcess/Plugins/PluginProxy.cpp:
    (WebKit::PluginProxy::handleKeyboardEvent):
    (WebKit::PluginProxy::privateBrowsingStateChanged):
    Send messages.
    
    (WebKit::PluginProxy::proxiesForURL):
    (WebKit::PluginProxy::cookiesForURL):
    (WebKit::PluginProxy::setCookiesForURL):
    Call the plug-in controller.
    
    * WebProcess/Plugins/PluginProxy.messages.in:
    Add new messages.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 4c266e4..5894b12 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,72 @@
 
         Reviewed by Sam Weinig.
 
+        Implement newly added Plugin/PluginController member functions for out of process plug-ins
+        https://bugs.webkit.org/show_bug.cgi?id=47065
+        <rdar://problem/8507194>
+
+        * Platform/CoreIPC/Arguments.h:
+        Add typedefs.
+
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::handleMessage):
+        Add new handleMessage overload.
+
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::create):
+        Add an isPrivateBrowsingEnabled boolean.
+        
+        (WebKit::PluginControllerProxy::PluginControllerProxy):
+        Add an isPrivateBrowsingEnabled boolean.
+
+        (WebKit::PluginControllerProxy::proxiesForURL):
+        (WebKit::PluginControllerProxy::cookiesForURL):
+        (WebKit::PluginControllerProxy::setCookiesForURL):
+        Send messages to the web process.
+
+        (WebKit::PluginControllerProxy::isPrivateBrowsingEnabled):
+        Return whether private browsing is enabled or not.
+
+        (WebKit::PluginControllerProxy::handleKeyboardEvent):
+        Call Plugin::handleKeyboardEvent.
+
+        (WebKit::PluginControllerProxy::privateBrowsingStateChanged):
+        Call Plugin::privateBrowsingStateChanged.
+
+        * PluginProcess/PluginControllerProxy.messages.in:
+        Add new messages.
+
+        * PluginProcess/WebProcessConnection.cpp:
+        (WebKit::WebProcessConnection::createPlugin):
+        Pass the isPrivateBrowsingEnabled flag.
+
+        * PluginProcess/WebProcessConnection.h:
+        * PluginProcess/WebProcessConnection.messages.in:
+        Update CreatePlugin message parameters.
+
+        * WebProcess/Plugins/PluginProcessConnection.cpp:
+        (WebKit::PluginProcessConnection::didReceiveMessage):
+        (WebKit::PluginProcessConnection::didReceiveSyncMessage):
+        It's OK for a plug-in to not get a sync message.
+
+        * WebProcess/Plugins/PluginProcessConnection.h:
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::handleKeyboardEvent):
+        (WebKit::PluginProxy::privateBrowsingStateChanged):
+        Send messages.
+
+        (WebKit::PluginProxy::proxiesForURL):
+        (WebKit::PluginProxy::cookiesForURL):
+        (WebKit::PluginProxy::setCookiesForURL):
+        Call the plug-in controller.
+
+        * WebProcess/Plugins/PluginProxy.messages.in:
+        Add new messages.
+
+2010-10-03  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
         Send keyboard events to plug-ins
         https://bugs.webkit.org/show_bug.cgi?id=47064
         <rdar://problem/8507148>
diff --git a/WebKit2/Platform/CoreIPC/Arguments.h b/WebKit2/Platform/CoreIPC/Arguments.h
index b2fa428..63ec22d 100644
--- a/WebKit2/Platform/CoreIPC/Arguments.h
+++ b/WebKit2/Platform/CoreIPC/Arguments.h
@@ -167,6 +167,11 @@ template<typename T1, typename T2, typename T3> Arguments3<T1&, T2&, T3&> Out(T1
 
 template<typename T1, typename T2, typename T3, typename T4> class Arguments4 : Arguments3<T1, T2, T3> {
 public:
+    typedef T1 FirstArgumentType;
+    typedef T2 SecondArgumentType;
+    typedef T3 ThirdArgumentType;
+    typedef T4 FourthArgumentType;
+    
     Arguments4(T1 t1, T2 t2, T3 t3, T4 t4)
         : Arguments3<T1, T2, T3>(t1, t2, t3)
         , m_value(t4)
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index a01a01a..46686fb 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -141,6 +141,30 @@ void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object
     reply->encode(firstReplyArgument);
 }
 
+template<typename T, typename C, typename P1, typename P2, typename P3, typename P4, typename R1>
+void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1, P2, P3, P4, R1&))
+{
+    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
+    if (!arguments->decode(firstArgument))
+        return;
+
+    typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
+    if (!arguments->decode(secondArgument))
+        return;
+    
+    typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
+    if (!arguments->decode(thirdArgument))
+        return;
+
+    typename RemoveReference<typename T::FourthArgumentType>::Type fourthArgument;
+    if (!arguments->decode(fourthArgument))
+        return;
+
+    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
+    (object->*function)(firstArgument, secondArgument, thirdArgument, fourthArgument, 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 a7e9e19..30eb60e 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -42,15 +42,16 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<PluginControllerProxy> PluginControllerProxy::create(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent)
+PassOwnPtr<PluginControllerProxy> PluginControllerProxy::create(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled)
 {
-    return adoptPtr(new PluginControllerProxy(connection, pluginInstanceID, userAgent));
+    return adoptPtr(new PluginControllerProxy(connection, pluginInstanceID, userAgent, isPrivateBrowsingEnabled));
 }
 
-PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent)
+PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled)
     : m_connection(connection)
     , m_pluginInstanceID(pluginInstanceID)
     , m_userAgent(userAgent)
+    , m_isPrivateBrowsingEnabled(isPrivateBrowsingEnabled)
     , m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
 {
 }
@@ -180,6 +181,40 @@ void PluginControllerProxy::pluginProcessCrashed()
     notImplemented();
 }
 
+String PluginControllerProxy::proxiesForURL(const String& urlString)
+{
+    String proxyString;
+    
+    if (!m_connection->connection()->sendSync(Messages::PluginProxy::CookiesForURL(urlString),
+                                              Messages::PluginProxy::CookiesForURL::Reply(proxyString),
+                                              m_pluginInstanceID, 0))
+        return String();
+    
+    return proxyString;
+}
+
+String PluginControllerProxy::cookiesForURL(const String& urlString)
+{
+    String cookieString;
+
+    if (!m_connection->connection()->sendSync(Messages::PluginProxy::CookiesForURL(urlString),
+                                              Messages::PluginProxy::CookiesForURL::Reply(cookieString),
+                                              m_pluginInstanceID, 0))
+        return String();
+
+    return cookieString;
+}
+
+void PluginControllerProxy::setCookiesForURL(const String& urlString, const String& cookieString)
+{
+    m_connection->connection()->send(Messages::PluginProxy::SetCookiesForURL(urlString, cookieString), m_pluginInstanceID);
+}
+
+bool PluginControllerProxy::isPrivateBrowsingEnabled()
+{
+    return m_isPrivateBrowsingEnabled;
+}
+    
 void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle)
 {
     m_frameRect = frameRect;
@@ -239,7 +274,12 @@ void PluginControllerProxy::handleMouseLeaveEvent(const WebMouseEvent& mouseLeav
 {
     handled = m_plugin->handleMouseLeaveEvent(mouseLeaveEvent);
 }
-    
+
+void PluginControllerProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboardEvent, bool& handled)
+{
+    handled = m_plugin->handleKeyboardEvent(keyboardEvent);
+}
+
 void PluginControllerProxy::setFocus(bool hasFocus)
 {
     m_plugin->setFocus(hasFocus);
@@ -262,6 +302,11 @@ void PluginControllerProxy::windowVisibilityChanged(bool isVisible)
 }
 #endif
 
+void PluginControllerProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
+{
+    m_plugin->privateBrowsingStateChanged(isPrivateBrowsingEnabled);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index 38a5dc0..b6f59ea 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -48,7 +48,7 @@ class PluginControllerProxy : PluginController {
     WTF_MAKE_NONCOPYABLE(PluginControllerProxy);
 
 public:
-    static PassOwnPtr<PluginControllerProxy> create(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent);
+    static PassOwnPtr<PluginControllerProxy> create(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled);
     ~PluginControllerProxy();
 
     uint64_t pluginInstanceID() const { return m_pluginInstanceID; }
@@ -60,7 +60,7 @@ public:
     CoreIPC::SyncReplyMode didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
 
 private:
-    PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent);
+    PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled);
 
     void paint();
 
@@ -76,7 +76,11 @@ private:
     virtual void setStatusbarText(const String&);
     virtual bool isAcceleratedCompositingEnabled();
     virtual void pluginProcessCrashed();
-
+    virtual String proxiesForURL(const String&);
+    virtual String cookiesForURL(const String&);
+    virtual void setCookiesForURL(const String& urlString, const String& cookieString);
+    virtual bool isPrivateBrowsingEnabled();
+    
     // Message handlers.
     void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle);
     void didEvaluateJavaScript(uint64_t requestID, const String& requestURLString, const String& result);
@@ -88,17 +92,20 @@ private:
     void handleWheelEvent(const WebWheelEvent&, bool& handled);
     void handleMouseEnterEvent(const WebMouseEvent&, bool& handled);
     void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
+    void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled);
     void setFocus(bool);
 #if PLATFORM(MAC)
     void windowFocusChanged(bool);
     void windowFrameChanged(const WebCore::IntRect&);
     void windowVisibilityChanged(bool);
 #endif
+    void privateBrowsingStateChanged(bool);
 
     WebProcessConnection* m_connection;
     uint64_t m_pluginInstanceID;
 
     String m_userAgent;
+    bool m_isPrivateBrowsingEnabled;
 
     RefPtr<Plugin> m_plugin;
 
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
index cc6abf0..be840be 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.messages.in
+++ b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -53,6 +53,9 @@ messages -> PluginControllerProxy {
     # Sent when a mouse leave event should be processed.
     HandleMouseLeaveEvent(WebKit::WebMouseEvent mouseEvent) -> (bool handled)
 
+    # Sent when a keyboard should be processed.
+    HandleKeyboardEvent(WebKit::WebKeyboardEvent keyboardEvent) -> (bool handled)
+
     # Sent when the plug-in focus changes.
     SetFocus(bool isFocused)
 
@@ -66,6 +69,9 @@ messages -> PluginControllerProxy {
     # Sent when the containing NSWindow's visibility changes
     WindowVisibilityChanged(bool isVisible)
 #endif
+
+    # Set when private browsing is enabled or disabled
+    PrivateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
 }
 
 #endif
diff --git a/WebKit2/PluginProcess/WebProcessConnection.cpp b/WebKit2/PluginProcess/WebProcessConnection.cpp
index 968e01b..3b7601d 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -131,9 +131,9 @@ void WebProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIP
     // FIXME: Implement.
 }
 
-void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters& parameters, const String& userAgent, bool& result)
+void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters& parameters, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result)
 {
-    OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, pluginInstanceID, userAgent);
+    OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, pluginInstanceID, userAgent, isPrivateBrowsingEnabled);
 
     PluginControllerProxy* pluginControllerProxyPtr = pluginControllerProxy.get();
 
diff --git a/WebKit2/PluginProcess/WebProcessConnection.h b/WebKit2/PluginProcess/WebProcessConnection.h
index 28cf944..3b3e1c9 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/WebKit2/PluginProcess/WebProcessConnection.h
@@ -61,7 +61,7 @@ private:
 
     // Message handlers.
     CoreIPC::SyncReplyMode didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
-    void createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, const String& userAgent, bool& result);
+    void createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result);
     void destroyPlugin(uint64_t pluginInstanceID);
 
     RefPtr<CoreIPC::Connection> m_connection;
diff --git a/WebKit2/PluginProcess/WebProcessConnection.messages.in b/WebKit2/PluginProcess/WebProcessConnection.messages.in
index 7d6c1c0..8fa4952 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.messages.in
+++ b/WebKit2/PluginProcess/WebProcessConnection.messages.in
@@ -24,7 +24,7 @@
 
 messages -> WebProcessConnection {
     # Creates a plug-in instance with the given instance ID.
-    CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters, WTF::String userAgent) -> (bool result)
+    CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters, WTF::String userAgent, bool isPrivateBrowsingEnabled) -> (bool result)
 
     # Destroys the plug-in instance with the given instance ID.
     DestroyPlugin(uint64_t pluginInstanceID) -> ()
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp b/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
index 11a67c0..534d2e4 100644
--- a/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
@@ -70,8 +70,22 @@ void PluginProcessConnection::removePluginProxy(PluginProxy* plugin)
 
 void PluginProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
-    PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID());
-    pluginProxy->didReceivePluginProxyMessage(connection, messageID, arguments);
+    if (arguments->destinationID()) {
+        if (PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID()))
+            pluginProxy->didReceivePluginProxyMessage(connection, messageID, arguments);
+        return;
+    }
+
+    ASSERT_NOT_REACHED();
+}
+
+CoreIPC::SyncReplyMode PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
+{
+    if (PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID()))
+        return pluginProxy->didReceiveSyncPluginProxyMessage(connection, messageID, arguments, reply);
+    
+    ASSERT_NOT_REACHED();
+    return CoreIPC::AutomaticReply;
 }
 
 void PluginProcessConnection::didClose(CoreIPC::Connection*)
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnection.h b/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
index 68b2cee..2d2ef06 100644
--- a/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
@@ -61,6 +61,7 @@ private:
 
     // CoreIPC::Connection::Client
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    virtual CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     virtual void didClose(CoreIPC::Connection*);
     virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
     
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 46dee53..4747869 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -82,7 +82,7 @@ bool PluginProxy::initialize(PluginController* pluginController, const Parameter
     // Ask the plug-in process to create a plug-in.
     bool result = false;
 
-    if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(m_pluginInstanceID, parameters, pluginController->userAgent()),
+    if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(m_pluginInstanceID, parameters, pluginController->userAgent(), pluginController->isPrivateBrowsingEnabled()),
                                               Messages::WebProcessConnection::CreatePlugin::Reply(result),
                                               0, CoreIPC::Connection::NoTimeout))
         return false;
@@ -267,6 +267,17 @@ bool PluginProxy::handleMouseLeaveEvent(const WebMouseEvent& mouseLeaveEvent)
     return handled;
 }
 
+bool PluginProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboardEvent)
+{
+    bool handled = false;
+    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::HandleKeyboardEvent(keyboardEvent),
+                                              Messages::PluginControllerProxy::HandleKeyboardEvent::Reply(handled),
+                                              m_pluginInstanceID, CoreIPC::Connection::NoTimeout))
+        return false;
+    
+    return handled;
+}
+
 void PluginProxy::setFocus(bool hasFocus)
 {
     m_connection->connection()->send(Messages::PluginControllerProxy::SetFocus(hasFocus), m_pluginInstanceID);
@@ -296,6 +307,11 @@ void PluginProxy::windowVisibilityChanged(bool isVisible)
 }
 #endif
 
+void PluginProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
+{
+    m_connection->connection()->send(Messages::PluginControllerProxy::PrivateBrowsingStateChanged(isPrivateBrowsingEnabled), m_pluginInstanceID);
+}
+
 PluginController* PluginProxy::controller()
 {
     return m_pluginController;
@@ -306,6 +322,21 @@ void PluginProxy::loadURL(uint64_t requestID, const String& method, const String
     m_pluginController->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups);
 }
 
+void PluginProxy::proxiesForURL(const String& urlString, String& proxyString)
+{
+    proxyString = m_pluginController->proxiesForURL(urlString);
+}
+
+void PluginProxy::cookiesForURL(const String& urlString, String& cookieString)
+{
+    cookieString = m_pluginController->cookiesForURL(urlString);
+}
+
+void PluginProxy::setCookiesForURL(const String& urlString, const String& cookieString)
+{
+    m_pluginController->setCookiesForURL(urlString, cookieString);
+}
+    
 void PluginProxy::update(const IntRect& paintedRect)
 {
     IntRect paintedRectPluginCoordinates = paintedRect;
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index 4ea5e47..4bea06d 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -49,6 +49,7 @@ public:
     void pluginProcessCrashed();
 
     void didReceivePluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments);
+    CoreIPC::SyncReplyMode didReceiveSyncPluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
 
 private:
     explicit PluginProxy(PassRefPtr<PluginProcessConnection>);
@@ -77,6 +78,7 @@ private:
     virtual bool handleWheelEvent(const WebWheelEvent&);
     virtual bool handleMouseEnterEvent(const WebMouseEvent&);
     virtual bool handleMouseLeaveEvent(const WebMouseEvent&);
+    virtual bool handleKeyboardEvent(const WebKeyboardEvent&);
     virtual void setFocus(bool);
     virtual NPObject* pluginScriptableNPObject();
 #if PLATFORM(MAC)
@@ -85,12 +87,17 @@ private:
     virtual void windowVisibilityChanged(bool);
 #endif
 
+    virtual void privateBrowsingStateChanged(bool);
+
     virtual PluginController* controller();
 
     // Message handlers.
     void loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const WebCore::HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups);
     void update(const WebCore::IntRect& paintedRect);
-
+    void proxiesForURL(const String& urlString, String& proxyString);
+    void cookiesForURL(const String& urlString, String& cookieString);
+    void setCookiesForURL(const String& urlString, const String& cookieString);
+    
     RefPtr<PluginProcessConnection> m_connection;
     uint64_t m_pluginInstanceID;
 
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.messages.in b/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
index e4d85b0..39de361 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
@@ -28,6 +28,15 @@ messages -> PluginProxy {
 
     # Called when the plug-in has painted into its backing store.
     Update(WebCore::IntRect paintedRect)
+
+    # Returns a PAC style string with proxies for the given URL.
+    ProxiesForURL(WTF::String urlString) -> (WTF::String proxiesString)
+
+    # Returns the cookies for the given URL.
+    CookiesForURL(WTF::String urlString) -> (WTF::String cookieString)
+
+    # Sets the cookies for the given URL.
+    SetCookiesForURL(WTF::String urlString, WTF::String cookieString)
 }
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list