[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:20:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7f3d7b946e706b9cf9c9103167fb76b5929f3b2b
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 6 22:47:29 2010 +0000

    Separate actually calling the member function from decoding/encoding arguments
    and remove any ambiguities when calling the function.
    
    Reviewed by Sam Weinig.
    
    * Platform/CoreIPC/Arguments.h:
    * Platform/CoreIPC/HandleMessage.h:
    (CoreIPC::callMemberFunction):
    (CoreIPC::handleMessage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69245 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6aecdc3..63e1c24 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -19,6 +19,18 @@
 
         Reviewed by Sam Weinig.
 
+        Separate actually calling the member function from decoding/encoding arguments
+        and remove any ambiguities when calling the function.
+
+        * Platform/CoreIPC/Arguments.h:
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::callMemberFunction):
+        (CoreIPC::handleMessage):
+
+2010-10-06  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
         More Arguments.h cleanup.
 
         * Platform/CoreIPC/Arguments.h:
diff --git a/WebKit2/Platform/CoreIPC/Arguments.h b/WebKit2/Platform/CoreIPC/Arguments.h
index 43a5afc..000a5df 100644
--- a/WebKit2/Platform/CoreIPC/Arguments.h
+++ b/WebKit2/Platform/CoreIPC/Arguments.h
@@ -32,8 +32,9 @@
 
 namespace CoreIPC {
     
-class Arguments0 {
-public:
+struct Arguments0 {
+    typedef Arguments0 ValueType;
+
     void encode(ArgumentEncoder*) const 
     {
     }
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 69e0790..ad6c000 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -3,128 +3,91 @@
 
 namespace CoreIPC {
 
-template<typename T> struct RemoveReference { typedef T Type; };
-template<typename T> struct RemoveReference<T&> { typedef T Type; };
-
-template<typename T, typename C>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)())
+template<typename C, typename MF>
+void callMemberFunction(const Arguments0&, C* object, MF function)
 {
     (object->*function)();
 }
 
-template<typename T, typename C, typename P>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P))
+template<typename C, typename MF, typename P1>
+void callMemberFunction(const Arguments1<P1>& args, C* object, MF function)
 {
-    typename T::ValueType arguments;
-    if (!argumentDecoder->decode(arguments))
-        return;
-    (object->*function)(arguments.argument1);
+    (object->*function)(args.argument1);
 }
 
-template<typename T, typename C, typename P1, typename P2>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2))
+template<typename C, typename MF, typename P1, typename P2>
+void callMemberFunction(const Arguments2<P1, P2>& args, C* object, MF function)
 {
-    typename T::ValueType arguments;
-    if (!argumentDecoder->decode(arguments))
-        return;
-    (object->*function)(arguments.argument1, arguments.argument2);
+    (object->*function)(args.argument1, args.argument2);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename P3>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3))
+template<typename C, typename MF, typename P1, typename P2, typename P3>
+void callMemberFunction(const Arguments3<P1, P2, P3>& args, C* object, MF function)
 {
-    typename T::ValueType arguments;
-    if (!argumentDecoder->decode(arguments))
-        return;
-    (object->*function)(arguments.argument1, arguments.argument2, arguments.argument3);
+    (object->*function)(args.argument1, args.argument2, args.argument3);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6))
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4>
+void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, C* object, MF function)
 {
-    typename T::ValueType arguments;
-    if (!argumentDecoder->decode(arguments))
-        return;
-    (object->*function)(arguments.argument1, arguments.argument2, arguments.argument3, arguments.argument4, arguments.argument5, arguments.argument6);
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6, P7))
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5>
+void callMemberFunction(const Arguments5<P1, P2, P3, P4, P5>& args, C* object, MF function)
 {
-    typename T::ValueType arguments;
-    if (!argumentDecoder->decode(arguments))
-        return;
-    (object->*function)(arguments.argument1, arguments.argument2, arguments.argument3, arguments.argument4, arguments.argument5, arguments.argument6, arguments.argument7);
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5);
 }
-
-template<typename T, typename C, typename P1>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1))
+    
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
+void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, C* object, MF function)
 {
-    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
-    if (!argumentDecoder->decode(firstArgument))
-        return;
-
-    (object->*function)(firstArgument);
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6);
 }
 
-template<typename T, typename C, typename P1, typename R1>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, R1&))
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
+void callMemberFunction(const Arguments7<P1, P2, P3, P4, P5, P6, P7>& args, C* object, MF function)
 {
-    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
-    if (!argumentDecoder->decode(firstArgument))
-        return;
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, args.argument7);
+}
 
-    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
-    (object->*function)(firstArgument, firstReplyArgument);
-    replyEncoder->encode(firstReplyArgument);
+template<typename C, typename MF, typename P1>
+void callMemberFunction(const Arguments1<P1>& args, Arguments0&, C* object, MF function)
+{
+    (object->*function)(args.argument1);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename P3, typename R1>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, P3, R1&))
+template<typename C, typename MF, typename P1, typename R1>
+void callMemberFunction(const Arguments1<P1>& args, Arguments1<R1>& replyArgs, C* object, MF function)
 {
-    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
-    if (!argumentDecoder->decode(firstArgument))
-        return;
+    (object->*function)(args.argument1, replyArgs.argument1);
+}
 
-    typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
-    if (!argumentDecoder->decode(secondArgument))
-        return;
-    
-    typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
-    if (!argumentDecoder->decode(thirdArgument))
-        return;
-    
-    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
-    (object->*function)(firstArgument, secondArgument, thirdArgument, firstReplyArgument);
-    replyEncoder->encode(firstReplyArgument);
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename R1>
+void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, Arguments1<R1>& replyArgs, C* object, MF function)
+{
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, replyArgs.argument1);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename P3, typename P4, typename R1>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, P3, P4, R1&))
+template<typename T, typename C, typename MF>
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, MF function)
 {
     typename T::ValueType arguments;
     if (!argumentDecoder->decode(arguments))
         return;
-    
-    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
-    (object->*function)(arguments.argument1, arguments.argument2, arguments.argument3, arguments.argument4, firstReplyArgument);
-    replyEncoder->encode(firstReplyArgument);
+    callMemberFunction(arguments, object, function);
 }
 
-template<typename T, typename C, typename P1, typename P2, typename R1>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, R1&))
+template<typename T, typename C, typename MF>
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, MF function)
 {
-    typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
-    if (!argumentDecoder->decode(firstArgument))
+    typename T::ValueType arguments;
+    if (!argumentDecoder->decode(arguments))
         return;
 
-    typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
-    if (!argumentDecoder->decode(secondArgument))
-        return;
-    
-    typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
-    (object->*function)(firstArgument, secondArgument, firstReplyArgument);
-    replyEncoder->encode(firstReplyArgument);
+    typename T::Reply::ValueType replyArguments;
+    callMemberFunction(arguments, replyArguments, object, function);
+    replyEncoder->encode(replyArguments);
 }
 
 } // namespace CoreIPC

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list