[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:49:41 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 3633661a7cb88bffdfef316c6beb58612056e039
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 27 23:38:21 2010 +0000
Add WebProcessConnection CreatePlugin message
https://bugs.webkit.org/show_bug.cgi?id=46668
Reviewed by Adam Roben.
* DerivedSources.make:
Add WebProcessConnection.
* Platform/CoreIPC/HandleMessage.h:
Add handleMessage overload for a sync message with two input parameters
and one output parameter.
(CoreIPC::handleMessage):
* Platform/CoreIPC/MessageID.h:
Add MessageClassWebProcessConnection.
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::createPlugin):
Add stub.
* PluginProcess/WebProcessConnection.messages.in: Added.
* Scripts/webkit2/messages.py:
Include headers directly for types that we believe are nested structs.
* Scripts/webkit2/messages_unittest.py:
Update expected results.
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 8d7a2dc..d49a6ab 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -54,6 +54,38 @@
Reviewed by Adam Roben.
+ Add WebProcessConnection CreatePlugin message
+ https://bugs.webkit.org/show_bug.cgi?id=46668
+
+ * DerivedSources.make:
+ Add WebProcessConnection.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ Add handleMessage overload for a sync message with two input parameters
+ and one output parameter.
+
+ (CoreIPC::handleMessage):
+ * Platform/CoreIPC/MessageID.h:
+ Add MessageClassWebProcessConnection.
+
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::createPlugin):
+ Add stub.
+
+ * PluginProcess/WebProcessConnection.messages.in: Added.
+ * Scripts/webkit2/messages.py:
+ Include headers directly for types that we believe are nested structs.
+
+ * Scripts/webkit2/messages_unittest.py:
+ Update expected results.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+2010-09-27 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Adam Roben.
+
Add support for autogenerating synchronous message handlers
https://bugs.webkit.org/show_bug.cgi?id=46654
diff --git a/WebKit2/DerivedSources.make b/WebKit2/DerivedSources.make
index dc1c046..036adb2 100644
--- a/WebKit2/DerivedSources.make
+++ b/WebKit2/DerivedSources.make
@@ -8,6 +8,7 @@ MESSAGE_RECEIVERS = \
PluginProcess \
PluginProcessProxy \
WebPage \
+ WebProcessConnection \
#
SCRIPTS = \
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 7127ad7..a521df3 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -48,6 +48,22 @@ void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P1
(object->*function)(firstArgument, secondArgument, thirdArgument);
}
+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&))
+{
+ 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::Reply::FirstArgumentType>::Type firstReplyArgument;
+ (object->*function)(firstArgument, secondArgument, firstReplyArgument);
+ reply->encode(firstReplyArgument);
+}
+
} // namespace CoreIPC
#endif // HandleMessage_h
diff --git a/WebKit2/Platform/CoreIPC/MessageID.h b/WebKit2/Platform/CoreIPC/MessageID.h
index e6a50a0..ddd988d 100644
--- a/WebKit2/Platform/CoreIPC/MessageID.h
+++ b/WebKit2/Platform/CoreIPC/MessageID.h
@@ -51,6 +51,9 @@ enum MessageClass {
// Messages sent by the plug-in process to the UI process.
MessageClassPluginProcessProxy,
+
+ // Messages sent by the web process to the plug-in process.
+ MessageClassWebProcessConnection,
};
template<typename> struct MessageKindTraits { };
diff --git a/WebKit2/PluginProcess/WebProcessConnection.cpp b/WebKit2/PluginProcess/WebProcessConnection.cpp
index 4251193..2532a40 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -67,6 +67,9 @@ void WebProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIP
// FIXME: Implement.
}
+void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, bool& result)
+{
+}
} // namespace WebKit
diff --git a/WebKit2/PluginProcess/WebProcessConnection.h b/WebKit2/PluginProcess/WebProcessConnection.h
index 65bd1d2..c7f4e79 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/WebKit2/PluginProcess/WebProcessConnection.h
@@ -29,6 +29,7 @@
#if ENABLE(PLUGIN_PROCESS)
#include "Connection.h"
+#include "Plugin.h"
#include <wtf/RefCounted.h>
namespace WebKit {
@@ -51,6 +52,10 @@ private:
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+ // Message handlers.
+ CoreIPC::SyncReplyMode didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
+ void createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, bool& result);
+
RefPtr<CoreIPC::Connection> m_connection;
};
diff --git a/WebKit2/PluginProcess/WebProcessConnection.messages.in b/WebKit2/PluginProcess/WebProcessConnection.messages.in
new file mode 100644
index 0000000..5c6e52b
--- /dev/null
+++ b/WebKit2/PluginProcess/WebProcessConnection.messages.in
@@ -0,0 +1,30 @@
+# 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)
+
+messages -> WebProcessConnection {
+ # Creates a plug-in instance with the given instance ID.
+ CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters) -> (bool result)
+}
+
+#endif
diff --git a/WebKit2/Scripts/webkit2/messages.py b/WebKit2/Scripts/webkit2/messages.py
index b77fa48..780dc9b 100644
--- a/WebKit2/Scripts/webkit2/messages.py
+++ b/WebKit2/Scripts/webkit2/messages.py
@@ -206,28 +206,36 @@ def forward_declarations_for_namespace(namespace, types):
return ''.join(result)
-def forward_declarations(receiver):
+def forward_declarations_and_headers(receiver):
types_by_namespace = collections.defaultdict(set)
+
+ headers = set([
+ '"Arguments.h"',
+ '"MessageID.h"',
+ ])
+
for parameter in receiver.iterparameters():
type = parameter.type
split = type.split('::')
- if len(split) != 2:
- continue
- namespace = split[0]
- inner_type = split[1]
- types_by_namespace[namespace].add(inner_type)
- return '\n'.join([forward_declarations_for_namespace(namespace, types) for (namespace, types) in sorted(types_by_namespace.iteritems())])
+ if len(split) == 2:
+ namespace = split[0]
+ inner_type = split[1]
+ types_by_namespace[namespace].add(inner_type)
+ elif len(split) > 2:
+ # We probably have a nested struct, which means we can't forward declare it.
+ # Include its header instead.
+ headers.update(headers_for_type(type))
+
+ forward_declarations = '\n'.join([forward_declarations_for_namespace(namespace, types) for (namespace, types) in sorted(types_by_namespace.iteritems())])
+ headers = ['#include %s\n' % header for header in sorted(headers)]
+
+ return (forward_declarations, headers)
def generate_messages_header(file):
receiver = MessageReceiver.parse(file)
header_guard = messages_header_filename(receiver).replace('.', '_')
- headers = set([
- '"Arguments.h"',
- '"MessageID.h"',
- ])
-
result = []
result.append(_license_header)
@@ -239,10 +247,12 @@ def generate_messages_header(file):
if receiver.condition:
result.append('#if %s\n\n' % receiver.condition)
- result += ['#include %s\n' % header for header in sorted(headers)]
+ forward_declarations, headers = forward_declarations_and_headers(receiver)
+
+ result += headers
result.append('\n')
- result.append(forward_declarations(receiver))
+ result.append(forward_declarations)
result.append('\n')
result.append('namespace Messages {\n\nnamespace %s {\n\n' % receiver.name)
@@ -299,7 +309,6 @@ def argument_coder_headers_for_type(type):
def headers_for_type(type):
special_cases = {
- 'CoreIPC::MachPort': '"MachPort.h"',
'WTF::String': '<wtf/text/WTFString.h>',
'WebKit::WebKeyboardEvent': '"WebEvent.h"',
'WebKit::WebMouseEvent': '"WebEvent.h"',
@@ -312,9 +321,9 @@ def headers_for_type(type):
# We assume that we must include a header for a type iff it has a scope
# resolution operator (::).
split = type.split('::')
- if len(split) != 2:
+ if len(split) < 2:
return []
- if split[0] == 'WebKit':
+ if split[0] == 'WebKit' or split[0] == 'CoreIPC':
return ['"%s.h"' % split[1]]
return ['<%s/%s.h>' % tuple(split)]
diff --git a/WebKit2/Scripts/webkit2/messages_unittest.py b/WebKit2/Scripts/webkit2/messages_unittest.py
index f55b8b2..3f6e1cf 100644
--- a/WebKit2/Scripts/webkit2/messages_unittest.py
+++ b/WebKit2/Scripts/webkit2/messages_unittest.py
@@ -60,6 +60,7 @@ messages -> WebPage {
SendDoubleAndFloat(double d, float f)
SendInts(Vector<uint64_t> ints)
+ CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters) -> (bool result)
RunJavaScriptAlert(uint64_t frameID, WTF::String message) -> ()
GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins)
GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Connection::Handle connectionHandle) delayed
@@ -124,6 +125,19 @@ _expected_results = {
'base_class': 'CoreIPC::Arguments1<const Vector<uint64_t>&>',
},
{
+ 'name': 'CreatePlugin',
+ 'parameters': (
+ ('uint64_t', 'pluginInstanceID'),
+ ('WebKit::Plugin::Parameters', 'parameters')
+ ),
+ 'reply_parameters': (
+ ('bool', 'result'),
+ ),
+ 'condition': None,
+ 'base_class': 'CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parameters&>',
+ 'reply_base_class': 'CoreIPC::Arguments1<bool>',
+ },
+ {
'name': 'RunJavaScriptAlert',
'parameters': (
('uint64_t', 'frameID'),
@@ -230,6 +244,7 @@ _expected_header = """/*
#include "Arguments.h"
#include "MessageID.h"
+#include "Plugin.h"
namespace CoreIPC {
class MachPort;
@@ -256,6 +271,7 @@ enum Kind {
CloseID,
SendDoubleAndFloatID,
SendIntsID,
+ CreatePluginID,
RunJavaScriptAlertID,
GetPluginsID,
GetPluginProcessConnectionID,
@@ -308,6 +324,15 @@ struct SendInts : CoreIPC::Arguments1<const Vector<uint64_t>&> {
}
};
+struct CreatePlugin : CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parameters&> {
+ static const Kind messageID = CreatePluginID;
+ typedef CoreIPC::Arguments1<bool&> Reply;
+ CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters)
+ : CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parameters&>(pluginInstanceID, parameters)
+ {
+ }
+};
+
struct RunJavaScriptAlert : CoreIPC::Arguments2<uint64_t, const WTF::String&> {
static const Kind messageID = RunJavaScriptAlertID;
typedef CoreIPC::Arguments0 Reply;
@@ -391,6 +416,7 @@ _expected_receiver_implementation = """/*
#include "ArgumentDecoder.h"
#include "HandleMessage.h"
#include "MachPort.h"
+#include "Plugin.h"
#include "WebCoreArgumentCoders.h"
#include "WebEvent.h"
#include "WebPageMessages.h"
@@ -433,6 +459,9 @@ void WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID
CoreIPC::SyncReplyMode WebPage::didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
{
switch (messageID.get<Messages::WebPage::Kind>()) {
+ case Messages::WebPage::CreatePluginID:
+ CoreIPC::handleMessage<Messages::WebPage::CreatePlugin>(arguments, reply, this, &WebPage::createPlugin);
+ return CoreIPC::AutomaticReply;
case Messages::WebPage::RunJavaScriptAlertID:
CoreIPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(arguments, reply, this, &WebPage::runJavaScriptAlert);
return CoreIPC::AutomaticReply;
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 233a206..3b594e9 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -56,6 +56,9 @@
1A043D92124FF02B00FFBFB5 /* BackingStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A043D90124FF02B00FFBFB5 /* BackingStoreMac.mm */; };
1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043DBF124FF87500FFBFB5 /* PluginProxy.h */; };
1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043DC0124FF87500FFBFB5 /* PluginProxy.cpp */; };
+ 1A043F5A12514CF300FFBFB5 /* WebProcessConnection.messages.in in Resources */ = {isa = PBXBuildFile; fileRef = 1A043F5912514CF300FFBFB5 /* WebProcessConnection.messages.in */; };
+ 1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043F6712514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp */; };
+ 1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043F6812514D8B00FFBFB5 /* WebProcessConnectionMessages.h */; };
1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC601124A9F2C007EF4A5 /* PluginProcessManager.h */; };
1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC602124A9F2C007EF4A5 /* PluginProcessManager.cpp */; };
1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC6BE124BBD9B007EF4A5 /* PluginProcessMessages.h */; };
@@ -475,6 +478,9 @@
1A043D90124FF02B00FFBFB5 /* BackingStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackingStoreMac.mm; sourceTree = "<group>"; };
1A043DBF124FF87500FFBFB5 /* PluginProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProxy.h; sourceTree = "<group>"; };
1A043DC0124FF87500FFBFB5 /* PluginProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProxy.cpp; sourceTree = "<group>"; };
+ 1A043F5912514CF300FFBFB5 /* WebProcessConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebProcessConnection.messages.in; sourceTree = "<group>"; };
+ 1A043F6712514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebProcessConnectionMessageReceiver.cpp; path = /Users/andersca/Build/Debug/DerivedSources/WebKit2/WebProcessConnectionMessageReceiver.cpp; sourceTree = "<absolute>"; };
+ 1A043F6812514D8B00FFBFB5 /* WebProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebProcessConnectionMessages.h; path = /Users/andersca/Build/Debug/DerivedSources/WebKit2/WebProcessConnectionMessages.h; sourceTree = "<absolute>"; };
1A0EC601124A9F2C007EF4A5 /* PluginProcessManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessManager.h; sourceTree = "<group>"; };
1A0EC602124A9F2C007EF4A5 /* PluginProcessManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessManager.cpp; sourceTree = "<group>"; };
1A0EC6B1124BBD36007EF4A5 /* PluginProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginProcess.messages.in; sourceTree = "<group>"; };
@@ -952,6 +958,7 @@
1A0EC7FA124BD3B6007EF4A5 /* PluginProcessMain.h */,
1A043A08124D11A900FFBFB5 /* WebProcessConnection.cpp */,
1A043A07124D11A900FFBFB5 /* WebProcessConnection.h */,
+ 1A043F5912514CF300FFBFB5 /* WebProcessConnection.messages.in */,
);
path = PluginProcess;
sourceTree = "<group>";
@@ -1639,6 +1646,8 @@
1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */,
C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
+ 1A043F6712514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp */,
+ 1A043F6812514D8B00FFBFB5 /* WebProcessConnectionMessages.h */,
);
name = "Derived Sources";
path = DerivedSources/WebKit2;
@@ -1861,6 +1870,7 @@
1A043D7A124FEFC100FFBFB5 /* BackingStore.h in Headers */,
BC40783D1250FADD0068F20A /* WKEvent.h in Headers */,
1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */,
+ 1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1910,6 +1920,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WebKit2" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -1945,6 +1956,7 @@
files = (
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
1A043B4D124D5E3600FFBFB5 /* PluginProcessProxy.messages.in in Resources */,
+ 1A043F5A12514CF300FFBFB5 /* WebProcessConnection.messages.in in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2146,6 +2158,7 @@
1A043D7B124FEFC100FFBFB5 /* BackingStore.cpp in Sources */,
1A043D92124FF02B00FFBFB5 /* BackingStoreMac.mm in Sources */,
1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
+ 1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list