[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:43:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit f60bae80bc6687641f3ce80f16ef3619b1d9c709
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 24 00:09:33 2010 +0000
Add PluginProcessConnection and PluginProcessConnectionManager
https://bugs.webkit.org/show_bug.cgi?id=46425
Reviewed by Sam Weinig.
* WebKit2.xcodeproj/project.pbxproj:
Add files.
* WebProcess/Plugins/PluginProcessConnection.cpp:
Add empty file for now.
* WebProcess/Plugins/PluginProcessConnection.h:
Add header.
* WebProcess/Plugins/PluginProcessConnectionManager.cpp: Added.
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
Check for an existing plug-in process connection. If we don't have one, ask the
UI process to create one.
(WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
Remove the connection from our global vector.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 09b8f8b..71bf748 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-23 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add PluginProcessConnection and PluginProcessConnectionManager
+ https://bugs.webkit.org/show_bug.cgi?id=46425
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add files.
+
+ * WebProcess/Plugins/PluginProcessConnection.cpp:
+ Add empty file for now.
+
+ * WebProcess/Plugins/PluginProcessConnection.h:
+ Add header.
+
+ * WebProcess/Plugins/PluginProcessConnectionManager.cpp: Added.
+ (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
+ Check for an existing plug-in process connection. If we don't have one, ask the
+ UI process to create one.
+
+ (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
+ Remove the connection from our global vector.
+
2010-09-23 Adam Roben <aroben at apple.com>
Remove the DrawingAreaProxy parameter to
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index c4a14b6..111d0e6 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -51,6 +51,10 @@
1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC75D124BC7B2007EF4A5 /* PluginProcessProxy.cpp */; };
1A0EC7FB124BD3B6007EF4A5 /* PluginProcessMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC7FA124BD3B6007EF4A5 /* PluginProcessMain.h */; };
1A0EC803124BD41E007EF4A5 /* PluginProcessMainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */; };
+ 1A0EC906124C0AB8007EF4A5 /* PluginProcessConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC904124C0AB8007EF4A5 /* PluginProcessConnection.h */; };
+ 1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC905124C0AB8007EF4A5 /* PluginProcessConnection.cpp */; };
+ 1A0EC90F124C0AF5007EF4A5 /* PluginProcessConnectionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC90D124C0AF5007EF4A5 /* PluginProcessConnectionManager.h */; };
+ 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC90E124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp */; };
1A0F29CB120B37160053D1B9 /* VisitedLinkTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */; };
1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */; };
1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */; };
@@ -451,6 +455,10 @@
1A0EC75D124BC7B2007EF4A5 /* PluginProcessProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessProxy.cpp; sourceTree = "<group>"; };
1A0EC7FA124BD3B6007EF4A5 /* PluginProcessMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessMain.h; sourceTree = "<group>"; };
1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessMainMac.mm; sourceTree = "<group>"; };
+ 1A0EC904124C0AB8007EF4A5 /* PluginProcessConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnection.h; sourceTree = "<group>"; };
+ 1A0EC905124C0AB8007EF4A5 /* PluginProcessConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessConnection.cpp; sourceTree = "<group>"; };
+ 1A0EC90D124C0AF5007EF4A5 /* PluginProcessConnectionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManager.h; sourceTree = "<group>"; };
+ 1A0EC90E124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessConnectionManager.cpp; sourceTree = "<group>"; };
1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkTable.cpp; sourceTree = "<group>"; };
1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTable.h; sourceTree = "<group>"; };
1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkProvider.cpp; sourceTree = "<group>"; };
@@ -955,6 +963,10 @@
1A6FB7D011E651E200DB1371 /* Plugin.cpp */,
1A6FB7D111E651E200DB1371 /* Plugin.h */,
1AA56F2811E92BC80061B882 /* PluginController.h */,
+ 1A0EC905124C0AB8007EF4A5 /* PluginProcessConnection.cpp */,
+ 1A0EC904124C0AB8007EF4A5 /* PluginProcessConnection.h */,
+ 1A0EC90E124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp */,
+ 1A0EC90D124C0AF5007EF4A5 /* PluginProcessConnectionManager.h */,
1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */,
1A6FB7AD11E64B6800DB1371 /* PluginView.h */,
);
@@ -1769,6 +1781,8 @@
1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */,
1A0EC75E124BC7B2007EF4A5 /* PluginProcessProxy.h in Headers */,
1A0EC7FB124BD3B6007EF4A5 /* PluginProcessMain.h in Headers */,
+ 1A0EC906124C0AB8007EF4A5 /* PluginProcessConnection.h in Headers */,
+ 1A0EC90F124C0AF5007EF4A5 /* PluginProcessConnectionManager.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2043,6 +2057,8 @@
1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */,
1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */,
1A0EC803124BD41E007EF4A5 /* PluginProcessMainMac.mm in Sources */,
+ 1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
+ 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp b/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
new file mode 100644
index 0000000..bc1d958
--- /dev/null
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginProcessConnection.h"
+
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnection.h b/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
new file mode 100644
index 0000000..a9eb12b
--- /dev/null
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginProcessConnection_h
+#define PluginProcessConnection_h
+
+#if ENABLE(PLUGIN_PROCESS)
+
+#include "Connection.h"
+#include "Plugin.h"
+
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+// A CoreIPC connection to a plug-in process.
+
+namespace WebKit {
+
+class PluginInstanceProxy;
+class PluginProcessConnectionManager;
+
+class PluginProcessConnection : public RefCounted<PluginProcessConnection>, CoreIPC::Connection::Client {
+public:
+ static PassRefPtr<PluginProcessConnection> create(PluginProcessConnectionManager* pluginProcessConnectionManager, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier)
+ {
+ return adoptRef(new PluginProcessConnection(pluginProcessConnectionManager, pluginPath, connectionIdentifier));
+ }
+ ~PluginProcessConnection();
+
+ const String& pluginPath() const { return m_pluginPath; }
+
+ CoreIPC::Connection* connection() const { return m_connection.get(); }
+
+private:
+ PluginProcessConnection(PluginProcessConnectionManager* pluginProcessConnectionManager, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier);
+
+ // CoreIPC::Connection::Client
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didClose(CoreIPC::Connection*);
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+
+ PluginProcessConnectionManager* m_pluginProcessConnectionManager;
+ String m_pluginPath;
+
+ RefPtr<CoreIPC::Connection> m_connection;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(PLUGIN_PROCESS)
+
+#endif // PluginProcessConnection_h
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp b/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp
new file mode 100644
index 0000000..e2524da
--- /dev/null
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if ENABLE(PLUGIN_PROCESS)
+
+#include "PluginProcessConnectionManager.h"
+
+#include "ArgumentDecoder.h"
+#include "ArgumentEncoder.h"
+#include "MachPort.h"
+#include "PluginProcessConnection.h"
+#include "WebCoreArgumentCoders.h"
+#include "WebProcess.h"
+#include "WebProcessProxyMessageKinds.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebKit {
+
+PluginProcessConnectionManager& PluginProcessConnectionManager::shared()
+{
+ DEFINE_STATIC_LOCAL(PluginProcessConnectionManager, pluginProcessConnectionManager, ());
+ return pluginProcessConnectionManager;
+}
+
+PluginProcessConnectionManager::PluginProcessConnectionManager()
+{
+}
+
+PluginProcessConnectionManager::~PluginProcessConnectionManager()
+{
+}
+
+PluginProcessConnection* PluginProcessConnectionManager::getPluginProcessConnection(const String& pluginPath)
+{
+ for (size_t i = 0; i < m_pluginProcessConnections.size(); ++i) {
+ if (m_pluginProcessConnections[i]->pluginPath() == pluginPath)
+ return m_pluginProcessConnections[i].get();
+ }
+
+ CoreIPC::Connection::Identifier connectionIdentifier;
+ CoreIPC::MachPort connectionMachPort;
+ if (!WebProcess::shared().connection()->sendSync(WebProcessProxyMessage::GetPluginProcessConnection, 0,
+ CoreIPC::In(pluginPath),
+ CoreIPC::Out(connectionMachPort),
+ CoreIPC::Connection::NoTimeout))
+ return 0;
+
+ connectionIdentifier = connectionMachPort.port();
+ if (!connectionIdentifier)
+ return 0;
+
+ RefPtr<PluginProcessConnection> pluginProcessConnection = PluginProcessConnection::create(this, pluginPath, connectionIdentifier);
+ m_pluginProcessConnections.append(pluginProcessConnection);
+
+ return pluginProcessConnection.get();
+}
+
+void PluginProcessConnectionManager::removePluginProcessConnection(PluginProcessConnection* pluginProcessConnection)
+{
+ size_t vectorIndex = m_pluginProcessConnections.find(pluginProcessConnection);
+ ASSERT(vectorIndex != notFound);
+
+ m_pluginProcessConnections.remove(vectorIndex);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.h b/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.h
new file mode 100644
index 0000000..d7ba853
--- /dev/null
+++ b/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginProcessConnectionManager_h
+#define PluginProcessConnectionManager_h
+
+#if ENABLE(PLUGIN_PROCESS)
+
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
+
+// Manages plug-in process connections for the given web process.
+
+namespace WebKit {
+
+class PluginProcessConnection;
+
+class PluginProcessConnectionManager : Noncopyable {
+public:
+ static PluginProcessConnectionManager& shared();
+
+ PluginProcessConnection* getPluginProcessConnection(const String& pluginPath);
+ void removePluginProcessConnection(PluginProcessConnection*);
+
+private:
+ PluginProcessConnectionManager();
+ ~PluginProcessConnectionManager();
+
+ Vector<RefPtr<PluginProcessConnection> > m_pluginProcessConnections;
+};
+
+}
+
+#endif // ENABLE(PLUGIN_PROCESS)
+
+#endif // PluginProcessConnectionManager_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list