[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:30 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 6238a8540f22378097a0eafe7e56a98a31f41b66
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 29 19:17:33 2010 +0000
Implement LoadURL
https://bugs.webkit.org/show_bug.cgi?id=46826
Reviewed by Sam Weinig.
* Platform/CoreIPC/ArgumentCoders.h:
Move String argument coder here from WebCoreArgumentCoders.h. Add
argument coder for AtomicString.
* Platform/CoreIPC/Arguments.h:
Add typedefs for Arguments7.
* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::handleMessage):
Add handleMessage overload that takes 7 parameters.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::loadURL):
Send the LoadURL message.
* Scripts/webkit2/messages.py:
(parse_parameter_string): Use rsplit in case the type name contains spaces.
(argument_coder_headers_for_type): Special case Vector.
* Scripts/webkit2/messages_unittest.py:
Update results.
* Shared/WebCoreArgumentCoders.h:
Add argument coder for HTTPHeaderMap.
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::loadURL):
Ask the plug-in controller to load the URL.
* WebProcess/Plugins/PluginProxy.messages.in:
Add LoadURL message.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 1365cc7..8d680a2 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,45 @@
Reviewed by Sam Weinig.
+ Implement LoadURL
+ https://bugs.webkit.org/show_bug.cgi?id=46826
+
+ * Platform/CoreIPC/ArgumentCoders.h:
+ Move String argument coder here from WebCoreArgumentCoders.h. Add
+ argument coder for AtomicString.
+
+ * Platform/CoreIPC/Arguments.h:
+ Add typedefs for Arguments7.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC::handleMessage):
+ Add handleMessage overload that takes 7 parameters.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::loadURL):
+ Send the LoadURL message.
+
+ * Scripts/webkit2/messages.py:
+ (parse_parameter_string): Use rsplit in case the type name contains spaces.
+ (argument_coder_headers_for_type): Special case Vector.
+
+ * Scripts/webkit2/messages_unittest.py:
+ Update results.
+
+ * Shared/WebCoreArgumentCoders.h:
+ Add argument coder for HTTPHeaderMap.
+
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::loadURL):
+ Ask the plug-in controller to load the URL.
+
+ * WebProcess/Plugins/PluginProxy.messages.in:
+ Add LoadURL message.
+
+2010-09-29 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Handle getting the user agent in the plug-in process
https://bugs.webkit.org/show_bug.cgi?id=46819
diff --git a/WebKit2/Platform/CoreIPC/ArgumentCoders.h b/WebKit2/Platform/CoreIPC/ArgumentCoders.h
index 37c2f25..2065988 100644
--- a/WebKit2/Platform/CoreIPC/ArgumentCoders.h
+++ b/WebKit2/Platform/CoreIPC/ArgumentCoders.h
@@ -32,6 +32,8 @@
#include <wtf/HashMap.h>
#include <wtf/TypeTraits.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/WTFString.h>
namespace CoreIPC {
@@ -192,6 +194,65 @@ template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTrai
}
};
+template<> struct ArgumentCoder<String> {
+ static void encode(ArgumentEncoder* encoder, const String& string)
+ {
+ // Special case the null string.
+ if (string.isNull()) {
+ encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
+ return;
+ }
+
+ uint32_t length = string.length();
+ encoder->encode(length);
+ encoder->encodeBytes(reinterpret_cast<const uint8_t*>(string.characters()), length * sizeof(UChar));
+ }
+
+ static bool decode(ArgumentDecoder* decoder, String& s)
+ {
+ uint32_t length;
+ if (!decoder->decode(length))
+ return false;
+
+ if (length == std::numeric_limits<uint32_t>::max()) {
+ // This is the null string.
+ s = String();
+ return true;
+ }
+
+ // Before allocating the string, make sure that the decoder buffer is big enough.
+ if (!decoder->bufferIsLargeEnoughToContain<UChar>(length)) {
+ decoder->markInvalid();
+ return false;
+ }
+
+ UChar* buffer;
+ String string = String::createUninitialized(length, buffer);
+ if (!decoder->decodeBytes(reinterpret_cast<uint8_t*>(buffer), length * sizeof(UChar)))
+ return false;
+
+ s = string;
+ return true;
+ }
+};
+
+template<> struct ArgumentCoder<AtomicString> {
+ static void encode(ArgumentEncoder* encoder, const AtomicString& atomicString)
+ {
+ encoder->encode(atomicString.string());
+ }
+
+ static bool decode(ArgumentDecoder* decoder, AtomicString& atomicString)
+ {
+ String string;
+ if (!decoder->decode(string))
+ return false;
+
+ atomicString = string;
+ return true;
+ }
+};
+
} // namespace CoreIPC
#endif // SimpleArgumentCoder_h
diff --git a/WebKit2/Platform/CoreIPC/Arguments.h b/WebKit2/Platform/CoreIPC/Arguments.h
index e469598..3c8d8d9 100644
--- a/WebKit2/Platform/CoreIPC/Arguments.h
+++ b/WebKit2/Platform/CoreIPC/Arguments.h
@@ -275,6 +275,14 @@ template<typename T1, typename T2, typename T3, typename T4, typename T5, typena
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> class Arguments7 : Arguments6<T1, T2, T3, T4, T5, T6> {
public:
+ typedef T1 FirstArgumentType;
+ typedef T2 SecondArgumentType;
+ typedef T3 ThirdArgumentType;
+ typedef T4 FourthArgumentType;
+ typedef T5 FifthArgumentType;
+ typedef T6 SixthArgumentType;
+ typedef T7 SeventhArgumentType;
+
Arguments7(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
: Arguments6<T1, T2, T3, T4, T5, T6>(t1, t2, t3, t4, t5, t6)
, m_value(t7)
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 4c1cb4d..8b169b8 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -48,6 +48,33 @@ 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 P3, typename P4, typename P5, typename P6, typename P7>
+void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6, P7))
+{
+ 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::FifthArgumentType>::Type fifthArgument;
+ if (!arguments->decode(fifthArgument))
+ return;
+ typename RemoveReference<typename T::SixthArgumentType>::Type sixthArgument;
+ if (!arguments->decode(sixthArgument))
+ return;
+ typename RemoveReference<typename T::SeventhArgumentType>::Type seventhArgument;
+ if (!arguments->decode(seventhArgument))
+ return;
+ (object->*function)(firstArgument, secondArgument, thirdArgument, fourthArgument, fifthArgument, sixthArgument, seventhArgument);
+}
+
template<typename T, typename C, typename P1>
void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1))
{
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 0f5f894..dd69e3e 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -132,7 +132,7 @@ String PluginControllerProxy::userAgent()
void PluginControllerProxy::loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups)
{
- notImplemented();
+ m_connection->connection()->send(Messages::PluginProxy::LoadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups), m_pluginInstanceID);
}
void PluginControllerProxy::cancelStreamLoad(uint64_t streamID)
diff --git a/WebKit2/Scripts/webkit2/messages.py b/WebKit2/Scripts/webkit2/messages.py
index 4171352..3e61902 100644
--- a/WebKit2/Scripts/webkit2/messages.py
+++ b/WebKit2/Scripts/webkit2/messages.py
@@ -119,7 +119,7 @@ class Parameter(object):
def parse_parameter_string(parameter_string):
- return [Parameter(*type_and_name.split(' ')) for type_and_name in parameter_string.split(', ')]
+ return [Parameter(*type_and_name.rsplit(' ', 1)) for type_and_name in parameter_string.split(', ')]
def messages_header_filename(receiver):
@@ -297,8 +297,14 @@ def sync_case_statement(receiver, message):
def argument_coder_headers_for_type(type):
+ # Check for Vector.
+ match = re.search(r'Vector<(.+)>', type)
+ if match:
+ element_type = match.groups()[0].strip()
+ return ['"ArgumentCoders.h"'] + argument_coder_headers_for_type(element_type)
+
special_cases = {
- 'WTF::String': '"WebCoreArgumentCoders.h"',
+ 'WTF::String': '"ArgumentCoders.h"',
}
if type in special_cases:
diff --git a/WebKit2/Scripts/webkit2/messages_unittest.py b/WebKit2/Scripts/webkit2/messages_unittest.py
index 3f6e1cf..01f38fc 100644
--- a/WebKit2/Scripts/webkit2/messages_unittest.py
+++ b/WebKit2/Scripts/webkit2/messages_unittest.py
@@ -58,7 +58,7 @@ messages -> WebPage {
Close()
SendDoubleAndFloat(double d, float f)
- SendInts(Vector<uint64_t> ints)
+ SendInts(Vector<uint64_t> ints, Vector<Vector<uint64_t> > intVectors)
CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters) -> (bool result)
RunJavaScriptAlert(uint64_t frameID, WTF::String message) -> ()
@@ -120,6 +120,7 @@ _expected_results = {
'name': 'SendInts',
'parameters': (
('Vector<uint64_t>', 'ints'),
+ ('Vector<Vector<uint64_t> >', 'intVectors')
),
'condition': None,
'base_class': 'CoreIPC::Arguments1<const Vector<uint64_t>&>',
@@ -316,10 +317,10 @@ struct SendDoubleAndFloat : CoreIPC::Arguments2<double, float> {
}
};
-struct SendInts : CoreIPC::Arguments1<const Vector<uint64_t>&> {
+struct SendInts : CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vector<uint64_t> >&> {
static const Kind messageID = SendIntsID;
- explicit SendInts(const Vector<uint64_t>& ints)
- : CoreIPC::Arguments1<const Vector<uint64_t>&>(ints)
+ SendInts(const Vector<uint64_t>& ints, const Vector<Vector<uint64_t> >& intVectors)
+ : CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vector<uint64_t> >&>(ints, intVectors)
{
}
};
@@ -413,6 +414,7 @@ _expected_receiver_implementation = """/*
#include "WebPage.h"
+#include "ArgumentCoders.h"
#include "ArgumentDecoder.h"
#include "HandleMessage.h"
#include "MachPort.h"
diff --git a/WebKit2/Shared/WebCoreArgumentCoders.h b/WebKit2/Shared/WebCoreArgumentCoders.h
index c9b7cab..b4064b2 100644
--- a/WebKit2/Shared/WebCoreArgumentCoders.h
+++ b/WebKit2/Shared/WebCoreArgumentCoders.h
@@ -36,7 +36,6 @@
#include <WebCore/PluginData.h>
#include <WebCore/ResourceRequest.h>
#include <limits>
-#include <wtf/text/WTFString.h>
namespace CoreIPC {
@@ -44,48 +43,6 @@ template<> struct ArgumentCoder<WebCore::IntPoint> : SimpleArgumentCoder<WebCore
template<> struct ArgumentCoder<WebCore::IntSize> : SimpleArgumentCoder<WebCore::IntSize> { };
template<> struct ArgumentCoder<WebCore::IntRect> : SimpleArgumentCoder<WebCore::IntRect> { };
-template<> struct ArgumentCoder<String> {
- static void encode(ArgumentEncoder* encoder, const String& string)
- {
- // Special case the null string.
- if (string.isNull()) {
- encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
- return;
- }
-
- uint32_t length = string.length();
- encoder->encode(length);
- encoder->encodeBytes(reinterpret_cast<const uint8_t*>(string.characters()), length * sizeof(UChar));
- }
-
- static bool decode(ArgumentDecoder* decoder, String& s)
- {
- uint32_t length;
- if (!decoder->decode(length))
- return false;
-
- if (length == std::numeric_limits<uint32_t>::max()) {
- // This is the null string.
- s = String();
- return true;
- }
-
- // Before allocating the string, make sure that the decoder buffer is big enough.
- if (!decoder->bufferIsLargeEnoughToContain<UChar>(length)) {
- decoder->markInvalid();
- return false;
- }
-
- UChar* buffer;
- String string = String::createUninitialized(length, buffer);
- if (!decoder->decodeBytes(reinterpret_cast<uint8_t*>(buffer), length * sizeof(UChar)))
- return false;
-
- s = string;
- return true;
- }
-};
-
template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
static void encode(ArgumentEncoder* encoder, const WebCore::MimeClassInfo& mimeClassInfo)
{
@@ -131,6 +88,18 @@ template<> struct ArgumentCoder<WebCore::PluginInfo> {
}
};
+template<> struct ArgumentCoder<WebCore::HTTPHeaderMap> {
+ static void encode(ArgumentEncoder* encoder, const WebCore::HTTPHeaderMap& headerMap)
+ {
+ encoder->encode(static_cast<const HashMap<AtomicString, String, CaseFoldingHash>&>(headerMap));
+ }
+
+ static bool decode(ArgumentDecoder* decoder, WebCore::HTTPHeaderMap& headerMap)
+ {
+ return decoder->decode(static_cast<HashMap<AtomicString, String, CaseFoldingHash>&>(headerMap));
+ }
+};
+
#if USE(LAZY_NATIVE_CURSOR)
template<> struct ArgumentCoder<WebCore::Cursor> {
static void encode(ArgumentEncoder* encoder, const WebCore::Cursor& cursor)
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 8bc342d..72ad959 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -300,6 +300,11 @@ PluginController* PluginProxy::controller()
return m_pluginController;
}
+void PluginProxy::loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups)
+{
+ m_pluginController->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups);
+}
+
void PluginProxy::update(const IntRect& paintedRect)
{
IntRect paintedRectPluginCoordinates = paintedRect;
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index f485322..4ea5e47 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -31,6 +31,10 @@
#include "Connection.h"
#include "Plugin.h"
+namespace WebCore {
+ class HTTPHeaderMap;
+}
+
namespace WebKit {
class BackingStore;
@@ -84,6 +88,7 @@ private:
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);
RefPtr<PluginProcessConnection> m_connection;
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.messages.in b/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
index 148c318..e4d85b0 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
@@ -23,6 +23,9 @@
#if ENABLE(PLUGIN_PROCESS)
messages -> PluginProxy {
+ # Asks the web process to load a URL.
+ LoadURL(uint64_t requestID, WTF::String method, WTF::String urlString, WTF::String target, WebCore::HTTPHeaderMap headerFields, Vector<uint8_t> httpBody, bool allowPopups);
+
# Called when the plug-in has painted into its backing store.
Update(WebCore::IntRect paintedRect)
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list