[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:31 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e71bbd55348edcb28a722d35a096da89f0ecbdfb
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 6 21:48:50 2010 +0000
Start cleaning up Arguments.h
https://bugs.webkit.org/show_bug.cgi?id=47304
Reviewed by Sam Weinig.
JavaScriptCore:
* wtf/TypeTraits.h:
* wtf/TypeTraits.cpp:
Add RemoveReference type trait.
WebKit2:
This is a first step towards simplifying all the handleMessage overloads we have.
* Platform/CoreIPC/Arguments.h:
(CoreIPC::Arguments1):
Make Arguments1 a struct and get rid of the FirstArgumentType typedef. Instead, add a
ValueType typedef which is defined to an Arguments1 type whose type parameter is not
a reference type.
* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::handleMessage):
Update for the Arguments1 change. Rename "arguments" to "argumentDecoder" and "reply" to
"replyEncoder".
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 668e47c..be0c682 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-06 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Start cleaning up Arguments.h
+ https://bugs.webkit.org/show_bug.cgi?id=47304
+
+ * wtf/TypeTraits.h:
+ * wtf/TypeTraits.cpp:
+ Add RemoveReference type trait.
+
2010-10-06 Rafael Antognolli <antognolli at profusion.mobi>
Unreviewed build fix.
diff --git a/JavaScriptCore/wtf/TypeTraits.cpp b/JavaScriptCore/wtf/TypeTraits.cpp
index a55019b..afeaa5e 100644
--- a/JavaScriptCore/wtf/TypeTraits.cpp
+++ b/JavaScriptCore/wtf/TypeTraits.cpp
@@ -136,4 +136,7 @@ COMPILE_ASSERT((IsSameType<int, RemovePointer<int>::Type>::value), WTF_Test_Remo
COMPILE_ASSERT((IsSameType<int, RemovePointer<int*>::Type>::value), WTF_Test_RemovePointer_int_pointer);
COMPILE_ASSERT((!IsSameType<int, RemovePointer<int**>::Type>::value), WTF_Test_RemovePointer_int_pointer_pointer);
+COMPILE_ASSERT((IsSameType<int, RemoveReference<int>::Type>::value), WTF_Test_RemoveReference_int);
+COMPILE_ASSERT((IsSameType<int, RemoveReference<int&>::Type>::value), WTF_Test_RemoveReference_int_reference);
+
} // namespace WTF
diff --git a/JavaScriptCore/wtf/TypeTraits.h b/JavaScriptCore/wtf/TypeTraits.h
index cf9b4af..44103cd 100644
--- a/JavaScriptCore/wtf/TypeTraits.h
+++ b/JavaScriptCore/wtf/TypeTraits.h
@@ -39,6 +39,7 @@ namespace WTF {
// IsSameType<T, U>::value
//
// RemovePointer<T>::Type
+ // RemoveReference<T>::Type
// RemoveConst<T>::Type
// RemoveVolatile<T>::Type
// RemoveConstVolatile<T>::Type
@@ -170,6 +171,14 @@ namespace WTF {
typedef T Type;
};
+ template <typename T> struct RemoveReference {
+ typedef T Type;
+ };
+
+ template <typename T> struct RemoveReference<T&> {
+ typedef T Type;
+ };
+
#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
// GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace.
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 596ca1f..3019d92 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,23 @@
+2010-10-06 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Start cleaning up Arguments.h
+ https://bugs.webkit.org/show_bug.cgi?id=47304
+
+ This is a first step towards simplifying all the handleMessage overloads we have.
+
+ * Platform/CoreIPC/Arguments.h:
+ (CoreIPC::Arguments1):
+ Make Arguments1 a struct and get rid of the FirstArgumentType typedef. Instead, add a
+ ValueType typedef which is defined to an Arguments1 type whose type parameter is not
+ a reference type.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC::handleMessage):
+ Update for the Arguments1 change. Rename "arguments" to "argumentDecoder" and "reply" to
+ "replyEncoder".
+
2010-10-06 Andras Becsi <abecsi at webkit.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/Platform/CoreIPC/Arguments.h b/WebKit2/Platform/CoreIPC/Arguments.h
index 63ec22d..ecc803d 100644
--- a/WebKit2/Platform/CoreIPC/Arguments.h
+++ b/WebKit2/Platform/CoreIPC/Arguments.h
@@ -28,6 +28,7 @@
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
+#include <wtf/TypeTraits.h>
namespace CoreIPC {
@@ -53,27 +54,29 @@ inline Arguments0 Out()
return Arguments0();
}
-template<typename T1> class Arguments1 {
-public:
- typedef T1 FirstArgumentType;
+template<typename T1> struct Arguments1 {
+ typedef Arguments1<typename WTF::RemoveReference<T1>::Type> ValueType;
+
+ Arguments1()
+ {
+ }
Arguments1(T1 t1)
- : m_value(t1)
+ : argument1(t1)
{
}
void encode(ArgumentEncoder* encoder) const
{
- encoder->encode(m_value);
+ encoder->encode(argument1);
}
static bool decode(ArgumentDecoder* decoder, Arguments1& result)
{
- return decoder->decode(result.m_value);
+ return decoder->decode(result.argument1);
}
-private:
- T1 m_value;
+ T1 argument1;
};
template<typename T1> Arguments1<const T1&> In(const T1& t1)
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 46686fb..33627ac 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -7,178 +7,178 @@ 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* arguments, C* object, void (C::*function)())
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)())
{
(object->*function)();
}
template<typename T, typename C, typename P>
-void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P))
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P))
{
- typename RemoveReference<typename T::FirstArgumentType>::Type argument;
- if (!arguments->decode(argument))
+ typename T::ValueType arguments;
+ if (!argumentDecoder->decode(arguments))
return;
- (object->*function)(argument);
+ (object->*function)(arguments.argument1);
}
template<typename T, typename C, typename P1, typename P2>
-void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P1, P2))
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
(object->*function)(firstArgument, secondArgument);
}
template<typename T, typename C, typename P1, typename P2, typename P3>
-void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P1, P2, P3))
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
- if (!arguments->decode(thirdArgument))
+ if (!argumentDecoder->decode(thirdArgument))
return;
(object->*function)(firstArgument, secondArgument, thirdArgument);
}
template<typename T, typename C, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
-void handleMessage(ArgumentDecoder* arguments, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6))
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
- if (!arguments->decode(thirdArgument))
+ if (!argumentDecoder->decode(thirdArgument))
return;
typename RemoveReference<typename T::FourthArgumentType>::Type fourthArgument;
- if (!arguments->decode(fourthArgument))
+ if (!argumentDecoder->decode(fourthArgument))
return;
typename RemoveReference<typename T::FifthArgumentType>::Type fifthArgument;
- if (!arguments->decode(fifthArgument))
+ if (!argumentDecoder->decode(fifthArgument))
return;
typename RemoveReference<typename T::SixthArgumentType>::Type sixthArgument;
- if (!arguments->decode(sixthArgument))
+ if (!argumentDecoder->decode(sixthArgument))
return;
(object->*function)(firstArgument, secondArgument, thirdArgument, fourthArgument, fifthArgument, sixthArgument);
}
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))
+void handleMessage(ArgumentDecoder* argumentDecoder, C* object, void (C::*function)(P1, P2, P3, P4, P5, P6, P7))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
- if (!arguments->decode(thirdArgument))
+ if (!argumentDecoder->decode(thirdArgument))
return;
typename RemoveReference<typename T::FourthArgumentType>::Type fourthArgument;
- if (!arguments->decode(fourthArgument))
+ if (!argumentDecoder->decode(fourthArgument))
return;
typename RemoveReference<typename T::FifthArgumentType>::Type fifthArgument;
- if (!arguments->decode(fifthArgument))
+ if (!argumentDecoder->decode(fifthArgument))
return;
typename RemoveReference<typename T::SixthArgumentType>::Type sixthArgument;
- if (!arguments->decode(sixthArgument))
+ if (!argumentDecoder->decode(sixthArgument))
return;
typename RemoveReference<typename T::SeventhArgumentType>::Type seventhArgument;
- if (!arguments->decode(seventhArgument))
+ if (!argumentDecoder->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))
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
(object->*function)(firstArgument);
}
template<typename T, typename C, typename P1, typename R1>
-void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1, R1&))
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, R1&))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
(object->*function)(firstArgument, firstReplyArgument);
- reply->encode(firstReplyArgument);
+ replyEncoder->encode(firstReplyArgument);
}
template<typename T, typename C, typename P1, typename P2, typename P3, typename R1>
-void handleMessage(ArgumentDecoder* arguments, ArgumentEncoder* reply, C* object, void (C::*function)(P1, P2, P3, R1&))
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, P3, R1&))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
- if (!arguments->decode(thirdArgument))
+ if (!argumentDecoder->decode(thirdArgument))
return;
typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
(object->*function)(firstArgument, secondArgument, thirdArgument, firstReplyArgument);
- reply->encode(firstReplyArgument);
+ replyEncoder->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&))
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, P3, P4, R1&))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::ThirdArgumentType>::Type thirdArgument;
- if (!arguments->decode(thirdArgument))
+ if (!argumentDecoder->decode(thirdArgument))
return;
typename RemoveReference<typename T::FourthArgumentType>::Type fourthArgument;
- if (!arguments->decode(fourthArgument))
+ if (!argumentDecoder->decode(fourthArgument))
return;
typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
(object->*function)(firstArgument, secondArgument, thirdArgument, fourthArgument, firstReplyArgument);
- reply->encode(firstReplyArgument);
+ replyEncoder->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&))
+void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, void (C::*function)(P1, P2, R1&))
{
typename RemoveReference<typename T::FirstArgumentType>::Type firstArgument;
- if (!arguments->decode(firstArgument))
+ if (!argumentDecoder->decode(firstArgument))
return;
typename RemoveReference<typename T::SecondArgumentType>::Type secondArgument;
- if (!arguments->decode(secondArgument))
+ if (!argumentDecoder->decode(secondArgument))
return;
typename RemoveReference<typename T::Reply::FirstArgumentType>::Type firstReplyArgument;
(object->*function)(firstArgument, secondArgument, firstReplyArgument);
- reply->encode(firstReplyArgument);
+ replyEncoder->encode(firstReplyArgument);
}
} // namespace CoreIPC
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list