Diff
Modified: trunk/Source/WebCore/ChangeLog (243459 => 243460)
--- trunk/Source/WebCore/ChangeLog 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/ChangeLog 2019-03-25 21:23:15 UTC (rev 243460)
@@ -1,5 +1,24 @@
2019-03-25 Alex Christensen <[email protected]>
+ Enable IPC sending and receiving non-default-constructible types
+ https://bugs.webkit.org/show_bug.cgi?id=196132
+
+ Reviewed by Geoff Garen.
+
+ This basically just requires the decoding of std::tuple to return an Optional<std::tuple> instead of
+ constructing a std::tuple then decoding into it. I now decode synchronous replies into an Optional<std::tuple>
+ then move it into the tuple of references where the successfully decoded reply should go. This required
+ the synchronous reply types be move constructible and move assignable.
+
+ * Modules/indexeddb/shared/IDBRequestData.h:
+ * Modules/indexeddb/shared/IDBTransactionInfo.h:
+ * platform/DragImage.h:
+ * platform/PasteboardWriterData.h:
+ * platform/audio/mac/CAAudioStreamDescription.h:
+ * platform/graphics/RemoteVideoSample.h:
+
+2019-03-25 Alex Christensen <[email protected]>
+
Stop storing raw pointers to Documents
https://bugs.webkit.org/show_bug.cgi?id=196042
Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h (243459 => 243460)
--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -50,6 +50,8 @@
IDBRequestData(const IDBClient::IDBConnectionProxy&, const IDBOpenDBRequest&);
explicit IDBRequestData(IDBClient::TransactionOperation&);
IDBRequestData(const IDBRequestData&);
+ IDBRequestData(IDBRequestData&&) = default;
+ IDBRequestData& operator=(IDBRequestData&&) = default;
enum IsolatedCopyTag { IsolatedCopy };
IDBRequestData(const IDBRequestData&, IsolatedCopyTag);
Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h (243459 => 243460)
--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -50,6 +50,8 @@
static IDBTransactionInfo versionChange(const IDBServer::IDBConnectionToClient&, const IDBDatabaseInfo& originalDatabaseInfo, uint64_t newVersion);
IDBTransactionInfo(const IDBTransactionInfo&);
+ IDBTransactionInfo(IDBTransactionInfo&&) = default;
+ IDBTransactionInfo& operator=(IDBTransactionInfo&&) = default;
enum IsolatedCopyTag { IsolatedCopy };
IDBTransactionInfo(const IDBTransactionInfo&, IsolatedCopyTag);
Modified: trunk/Source/WebCore/platform/DragImage.h (243459 => 243460)
--- trunk/Source/WebCore/platform/DragImage.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/platform/DragImage.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -102,10 +102,10 @@
public:
WEBCORE_EXPORT DragImage();
explicit DragImage(DragImageRef);
- DragImage(DragImage&&);
+ WEBCORE_EXPORT DragImage(DragImage&&);
WEBCORE_EXPORT ~DragImage();
- DragImage& operator=(DragImage&&);
+ WEBCORE_EXPORT DragImage& operator=(DragImage&&);
void setIndicatorData(const TextIndicatorData& data) { m_indicatorData = data; }
bool hasIndicatorData() const { return !!m_indicatorData; }
Modified: trunk/Source/WebCore/platform/PasteboardWriterData.h (243459 => 243460)
--- trunk/Source/WebCore/platform/PasteboardWriterData.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/platform/PasteboardWriterData.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -47,7 +47,7 @@
struct WebContent {
WebContent();
- ~WebContent();
+ WEBCORE_EXPORT ~WebContent();
#if PLATFORM(COCOA)
String contentOrigin;
Modified: trunk/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h (243459 => 243460)
--- trunk/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -33,19 +33,19 @@
WEBCORE_EXPORT bool operator==(const AudioStreamBasicDescription&, const AudioStreamBasicDescription&);
inline bool operator!=(const AudioStreamBasicDescription& a, const AudioStreamBasicDescription& b) { return !(a == b); }
-class CAAudioStreamDescription final : public AudioStreamDescription {
+class WEBCORE_EXPORT CAAudioStreamDescription final : public AudioStreamDescription {
WTF_MAKE_FAST_ALLOCATED;
public:
- WEBCORE_EXPORT CAAudioStreamDescription();
- WEBCORE_EXPORT CAAudioStreamDescription(const AudioStreamBasicDescription&);
- WEBCORE_EXPORT CAAudioStreamDescription(double, uint32_t, PCMFormat, bool);
- WEBCORE_EXPORT ~CAAudioStreamDescription();
+ CAAudioStreamDescription();
+ CAAudioStreamDescription(const AudioStreamBasicDescription&);
+ CAAudioStreamDescription(double, uint32_t, PCMFormat, bool);
+ ~CAAudioStreamDescription();
const PlatformDescription& platformDescription() const final;
- WEBCORE_EXPORT PCMFormat format() const final;
+ PCMFormat format() const final;
double sampleRate() const final { return m_streamDescription.mSampleRate; }
bool isPCM() const final { return m_streamDescription.mFormatID == kAudioFormatLinearPCM; }
Modified: trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h (243459 => 243460)
--- trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -41,6 +41,8 @@
class RemoteVideoSample {
public:
RemoteVideoSample() = default;
+ RemoteVideoSample(RemoteVideoSample&&) = default;
+ RemoteVideoSample& operator=(RemoteVideoSample&&) = default;
~RemoteVideoSample() = default;
#if HAVE(IOSURFACE)
Modified: trunk/Source/WebKit/ChangeLog (243459 => 243460)
--- trunk/Source/WebKit/ChangeLog 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/ChangeLog 2019-03-25 21:23:15 UTC (rev 243460)
@@ -1,3 +1,53 @@
+2019-03-25 Alex Christensen <[email protected]>
+
+ Enable IPC sending and receiving non-default-constructible types
+ https://bugs.webkit.org/show_bug.cgi?id=196132
+
+ Reviewed by Geoff Garen.
+
+ * Platform/IPC/ArgumentCoder.h:
+ * Platform/IPC/ArgumentCoders.h:
+ (IPC::TupleEncoder::encode):
+ (IPC::tupleFromTupleAndObject):
+ (IPC::TupleDecoderImpl::decode):
+ (IPC::TupleDecoderImpl<Type>::decode):
+ (IPC::TupleDecoder::decode):
+ (IPC::TupleDecoder<0>::decode):
+ (IPC::TupleCoder::encode): Deleted.
+ (IPC::TupleCoder::decode): Deleted.
+ * Platform/IPC/Connection.h:
+ (IPC::Connection::sendWithReply):
+ (IPC::TupleMover::move):
+ (IPC::moveTuple):
+ (IPC::Connection::sendSync):
+ * Platform/IPC/Decoder.h:
+ (IPC::Decoder::decode):
+ (IPC::Decoder::operator>>):
+ * Platform/IPC/HandleMessage.h:
+ (IPC::handleMessage):
+ (IPC::handleMessageSynchronous):
+ (IPC::handleMessageSynchronousWantsConnection):
+ (IPC::handleMessageAsync):
+ * Platform/SharedMemory.h:
+ * Scripts/webkit/LegacyMessages-expected.h:
+ * Scripts/webkit/Messages-expected.h:
+ * Scripts/webkit/MessagesSuperclass-expected.h:
+ * Scripts/webkit/messages.py:
+ * Shared/Databases/IndexedDB/WebIDBResult.h:
+ * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
+ * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+ * Shared/ShareableBitmap.h:
+ * Shared/ShareableResource.h:
+ * Shared/UpdateInfo.h:
+ * Shared/WebEvent.h:
+ * Shared/WebProcessCreationParameters.cpp:
+ * Shared/WebProcessCreationParameters.h:
+ * Shared/mac/SecItemResponseData.cpp:
+ (WebKit::SecItemResponseData::SecItemResponseData):
+ (WebKit::SecItemResponseData::decode):
+ * Shared/mac/SecItemResponseData.h:
+ * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
+
2019-03-25 Tim Horton <[email protected]>
Animated keyboard scrolling is extremely chaotic
Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -41,6 +41,8 @@
template<typename> struct ArgumentCoder;
+template<typename> class UsesModernDecoder;
+
template<typename U>
class UsesModernDecoder {
private:
@@ -53,6 +55,13 @@
static constexpr bool argumentCoderValue = sizeof(check<U>(nullptr)) == sizeof(uint8_t);
static constexpr bool value = argumentCoderValue || sizeof(checkArgumentCoder<U>(nullptr)) == sizeof(uint8_t);
};
+
+template<typename... Types>
+class UsesModernDecoder<std::tuple<Types...>> {
+public:
+ static constexpr bool value = true;
+ static constexpr bool argumentCoderValue = true;
+};
template<typename U>
class UsesLegacyDecoder {
Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -160,58 +160,90 @@
};
template<size_t index, typename... Elements>
-struct TupleCoder {
+struct TupleEncoder {
static void encode(Encoder& encoder, const std::tuple<Elements...>& tuple)
{
encoder << std::get<sizeof...(Elements) - index>(tuple);
- TupleCoder<index - 1, Elements...>::encode(encoder, tuple);
+ TupleEncoder<index - 1, Elements...>::encode(encoder, tuple);
}
+};
- template<typename U = typename std::remove_reference<typename std::tuple_element<sizeof...(Elements) - index, std::tuple<Elements...>>::type>::type, std::enable_if_t<!UsesModernDecoder<U>::value>* = nullptr>
- static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple)
+template<typename... Elements>
+struct TupleEncoder<0, Elements...> {
+ static void encode(Encoder&, const std::tuple<Elements...>&)
{
- if (!decoder.decode(std::get<sizeof...(Elements) - index>(tuple)))
- return false;
- return TupleCoder<index - 1, Elements...>::decode(decoder, tuple);
}
-
- template<typename U = typename std::remove_reference<typename std::tuple_element<sizeof...(Elements) - index, std::tuple<Elements...>>::type>::type, std::enable_if_t<UsesModernDecoder<U>::value>* = nullptr>
- static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple)
+};
+
+template <typename T, typename... Elements, size_t... Indices>
+auto tupleFromTupleAndObject(T&& object, std::tuple<Elements...>&& tuple, std::index_sequence<Indices...>)
+{
+ return std::make_tuple(WTFMove(object), WTFMove(std::get<Indices>(tuple))...);
+}
+
+template <typename T, typename... Elements>
+auto tupleFromTupleAndObject(T&& object, std::tuple<Elements...>&& tuple)
+{
+ return tupleFromTupleAndObject(WTFMove(object), WTFMove(tuple), std::index_sequence_for<Elements...>());
+}
+
+template<typename Type, typename... Types>
+struct TupleDecoderImpl {
+ static Optional<std::tuple<Type, Types...>> decode(Decoder& decoder)
{
- Optional<U> optional;
+ Optional<Type> optional;
decoder >> optional;
if (!optional)
- return false;
- std::get<sizeof...(Elements) - index>(tuple) = WTFMove(*optional);
- return TupleCoder<index - 1, Elements...>::decode(decoder, tuple);
+ return WTF::nullopt;
+
+ Optional<std::tuple<Types...>> subTuple = TupleDecoderImpl<Types...>::decode(decoder);
+ if (!subTuple)
+ return WTF::nullopt;
+
+ return tupleFromTupleAndObject(WTFMove(*optional), WTFMove(*subTuple));
}
};
-template<typename... Elements>
-struct TupleCoder<0, Elements...> {
- static void encode(Encoder&, const std::tuple<Elements...>&)
+template<typename Type>
+struct TupleDecoderImpl<Type> {
+ static Optional<std::tuple<Type>> decode(Decoder& decoder)
{
+ Optional<Type> optional;
+ decoder >> optional;
+ if (!optional)
+ return WTF::nullopt;
+ return std::make_tuple(WTFMove(*optional));
}
+};
- static bool decode(Decoder&, std::tuple<Elements...>&)
+template<size_t size, typename... Elements>
+struct TupleDecoder {
+ static Optional<std::tuple<Elements...>> decode(Decoder& decoder)
{
- return true;
+ return TupleDecoderImpl<Elements...>::decode(decoder);
}
};
+template<>
+struct TupleDecoder<0> {
+ static Optional<std::tuple<>> decode(Decoder& decoder)
+ {
+ return std::make_tuple();
+ }
+};
+
template<typename... Elements> struct ArgumentCoder<std::tuple<Elements...>> {
static void encode(Encoder& encoder, const std::tuple<Elements...>& tuple)
{
- TupleCoder<sizeof...(Elements), Elements...>::encode(encoder, tuple);
+ TupleEncoder<sizeof...(Elements), Elements...>::encode(encoder, tuple);
}
- static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple)
+ static Optional<std::tuple<Elements...>> decode(Decoder& decoder)
{
- return TupleCoder<sizeof...(Elements), Elements...>::decode(decoder, tuple);
+ return TupleDecoder<sizeof...(Elements), Elements...>::decode(decoder);
}
};
-
template<typename KeyType, typename ValueType> struct ArgumentCoder<WTF::KeyValuePair<KeyType, ValueType>> {
static void encode(Encoder& encoder, const WTF::KeyValuePair<KeyType, ValueType>& pair)
{
Modified: trunk/Source/WebKit/Platform/IPC/Connection.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/IPC/Connection.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/IPC/Connection.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -444,9 +444,10 @@
sendMessageWithReply(requestID, WTFMove(encoder), replyDispatcher, [replyHandler = WTFMove(replyHandler)](std::unique_ptr<Decoder> decoder) {
if (decoder) {
- typename CodingType<typename T::Reply>::Type reply;
- if (decoder->decode(reply)) {
- replyHandler(WTFMove(reply));
+ Optional<typename CodingType<typename T::Reply>::Type> reply;
+ *decoder >> reply;
+ if (reply) {
+ replyHandler(WTFMove(*reply));
return;
}
}
@@ -455,6 +456,25 @@
});
}
+template<size_t i, typename A, typename B> struct TupleMover {
+ static void move(A&& a, B& b)
+ {
+ std::get<i - 1>(b) = WTFMove(std::get<i - 1>(a));
+ TupleMover<i - 1, A, B>::move(WTFMove(a), b);
+ }
+};
+
+template<typename A, typename B> struct TupleMover<0, A, B> {
+ static void move(A&&, B&) { }
+};
+
+template<typename... A, typename... B>
+void moveTuple(std::tuple<A...>&& a, std::tuple<B...>& b)
+{
+ static_assert(sizeof...(A) == sizeof...(B), "Should be used with two tuples of same size");
+ TupleMover<sizeof...(A), std::tuple<A...>, std::tuple<B...>>::move(WTFMove(a), b);
+}
+
template<typename T> bool Connection::sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
{
COMPILE_ASSERT(T::isSync, SyncMessageExpected);
@@ -476,7 +496,12 @@
return false;
// Decode the reply.
- return replyDecoder->decode(reply);
+ Optional<typename T::ReplyArguments> replyArguments;
+ *replyDecoder >> replyArguments;
+ if (!replyArguments)
+ return false;
+ moveTuple(WTFMove(*replyArguments), reply);
+ return true;
}
template<typename T> bool Connection::waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions)
Modified: trunk/Source/WebKit/Platform/IPC/Decoder.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/IPC/Decoder.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/IPC/Decoder.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -150,6 +150,17 @@
return ArgumentCoder<T>::decode(*this, t);
}
+ template<typename T, std::enable_if_t<!std::is_enum<T>::value && !UsesLegacyDecoder<T>::value>* = nullptr>
+ bool decode(T& t)
+ {
+ Optional<T> optional;
+ *this >> optional;
+ if (!optional)
+ return false;
+ t = WTFMove(*optional);
+ return true;
+ }
+
template<typename T, std::enable_if_t<UsesModernDecoder<T>::value>* = nullptr>
Decoder& operator>>(Optional<T>& t)
{
@@ -156,6 +167,18 @@
t = ArgumentCoder<T>::decode(*this);
return *this;
}
+
+ template<typename T, std::enable_if_t<!std::is_enum<T>::value && !UsesModernDecoder<T>::value>* = nullptr>
+ Decoder& operator>>(Optional<T>& optional)
+ {
+ T t;
+ if (ArgumentCoder<T>::decode(*this, t)) {
+ optional = WTFMove(t);
+ return *this;
+ }
+ optional = WTF::nullopt;
+ return *this;
+ }
bool removeAttachment(Attachment&);
Modified: trunk/Source/WebKit/Platform/IPC/HandleMessage.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/IPC/HandleMessage.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/IPC/HandleMessage.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -110,31 +110,34 @@
template<typename T, typename C, typename MF>
void handleMessage(Decoder& decoder, C* object, MF function)
{
- typename CodingType<typename T::Arguments>::Type arguments;
- if (!decoder.decode(arguments)) {
+ Optional<typename CodingType<typename T::Arguments>::Type> arguments;
+ decoder >> arguments;
+ if (!arguments) {
ASSERT(decoder.isInvalid());
return;
}
- callMemberFunction(WTFMove(arguments), object, function);
+ callMemberFunction(WTFMove(*arguments), object, function);
}
template<typename T, typename C, typename MF>
void handleMessage(Connection& connection, Decoder& decoder, C* object, MF function)
{
- typename CodingType<typename T::Arguments>::Type arguments;
- if (!decoder.decode(arguments)) {
+ Optional<typename CodingType<typename T::Arguments>::Type> arguments;
+ decoder >> arguments;
+ if (!arguments) {
ASSERT(decoder.isInvalid());
return;
}
- callMemberFunction(connection, WTFMove(arguments), object, function);
+ callMemberFunction(connection, WTFMove(*arguments), object, function);
}
template<typename T, typename C, typename MF>
void handleMessageSynchronous(Connection& connection, Decoder& decoder, std::unique_ptr<Encoder>& replyEncoder, C* object, MF function)
{
- typename CodingType<typename T::Arguments>::Type arguments;
- if (!decoder.decode(arguments)) {
+ Optional<typename CodingType<typename T::Arguments>::Type> arguments;
+ decoder >> arguments;
+ if (!arguments) {
ASSERT(decoder.isInvalid());
return;
}
@@ -142,14 +145,15 @@
typename T::DelayedReply completionHandler = [replyEncoder = WTFMove(replyEncoder), connection = makeRef(connection)] (auto&&... args) mutable {
T::send(WTFMove(replyEncoder), WTFMove(connection), args...);
};
- callMemberFunction(WTFMove(arguments), WTFMove(completionHandler), object, function);
+ callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function);
}
template<typename T, typename C, typename MF>
void handleMessageSynchronousWantsConnection(Connection& connection, Decoder& decoder, std::unique_ptr<Encoder>& replyEncoder, C* object, MF function)
{
- typename CodingType<typename T::Arguments>::Type arguments;
- if (!decoder.decode(arguments)) {
+ Optional<typename CodingType<typename T::Arguments>::Type> arguments;
+ decoder >> arguments;
+ if (!arguments) {
ASSERT(decoder.isInvalid());
return;
}
@@ -157,7 +161,7 @@
typename T::DelayedReply completionHandler = [replyEncoder = WTFMove(replyEncoder), connection = makeRef(connection)] (auto&&... args) mutable {
T::send(WTFMove(replyEncoder), WTFMove(connection), args...);
};
- callMemberFunction(connection, WTFMove(arguments), WTFMove(completionHandler), object, function);
+ callMemberFunction(connection, WTFMove(*arguments), WTFMove(completionHandler), object, function);
}
template<typename T, typename C, typename MF>
@@ -170,8 +174,9 @@
return;
}
- typename CodingType<typename T::Arguments>::Type arguments;
- if (!decoder.decode(arguments)) {
+ Optional<typename CodingType<typename T::Arguments>::Type> arguments;
+ decoder >> arguments;
+ if (!arguments) {
ASSERT(decoder.isInvalid());
return;
}
@@ -181,7 +186,7 @@
*encoder << listenerID;
T::send(WTFMove(encoder), WTFMove(connection), args...);
};
- callMemberFunction(WTFMove(arguments), WTFMove(completionHandler), object, function);
+ callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function);
}
} // namespace IPC
Modified: trunk/Source/WebKit/Platform/SharedMemory.h (243459 => 243460)
--- trunk/Source/WebKit/Platform/SharedMemory.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/SharedMemory.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -64,6 +64,8 @@
public:
Handle();
~Handle();
+ Handle(Handle&&);
+ Handle& operator=(Handle&&);
bool isNull() const;
Modified: trunk/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp (243459 => 243460)
--- trunk/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp 2019-03-25 21:23:15 UTC (rev 243460)
@@ -46,6 +46,19 @@
{
}
+SharedMemory::Handle::Handle(Handle&& other)
+{
+ m_port = std::exchange(other.m_port, MACH_PORT_NULL);
+ m_size = std::exchange(other.m_size, 0);
+}
+
+auto SharedMemory::Handle::operator=(Handle&& other) -> Handle&
+{
+ m_port = std::exchange(other.m_port, MACH_PORT_NULL);
+ m_size = std::exchange(other.m_size, 0);
+ return *this;
+}
+
SharedMemory::Handle::~Handle()
{
clear();
Modified: trunk/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp (243459 => 243460)
--- trunk/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp 2019-03-25 21:23:15 UTC (rev 243460)
@@ -59,6 +59,9 @@
{
}
+SharedMemory::Handle::Handle(Handle&&) = default;
+SharedMemory::Handle& SharedMemory::Handle::operator=(Handle&& other) = default;
+
void SharedMemory::Handle::clear()
{
m_attachment = IPC::Attachment();
Modified: trunk/Source/WebKit/Platform/win/SharedMemoryWin.cpp (243459 => 243460)
--- trunk/Source/WebKit/Platform/win/SharedMemoryWin.cpp 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Platform/win/SharedMemoryWin.cpp 2019-03-25 21:23:15 UTC (rev 243460)
@@ -39,6 +39,19 @@
{
}
+SharedMemory::Handle::Handle(Handle&& other)
+{
+ m_handle = std::exchange(other.m_handle, 0);
+ m_size = std::exchange(other.m_size, 0);
+}
+
+auto SharedMemory::Handle::operator=(Handle&& other) -> Handle&
+{
+ m_handle = std::exchange(other.m_handle, 0);
+ m_size = std::exchange(other.m_size, 0);
+ return *this;
+}
+
SharedMemory::Handle::~Handle()
{
clear();
Modified: trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h (243459 => 243460)
--- trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -288,7 +288,8 @@
static IPC::StringReference name() { return IPC::StringReference("CreatePlugin"); }
static const bool isSync = true;
- typedef std::tuple<bool&> Reply;
+ using Reply = std::tuple<bool&>;
+ using ReplyArguments = std::tuple<bool>;
CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters)
: m_arguments(pluginInstanceID, parameters)
{
@@ -311,7 +312,8 @@
static IPC::StringReference name() { return IPC::StringReference("RunJavaScriptAlert"); }
static const bool isSync = true;
- typedef std::tuple<> Reply;
+ using Reply = std::tuple<>;
+ using ReplyArguments = std::tuple<>;
RunJavaScriptAlert(uint64_t frameID, const String& message)
: m_arguments(frameID, message)
{
@@ -334,7 +336,8 @@
static IPC::StringReference name() { return IPC::StringReference("GetPlugins"); }
static const bool isSync = true;
- typedef std::tuple<Vector<WebCore::PluginInfo>&> Reply;
+ using Reply = std::tuple<Vector<WebCore::PluginInfo>&>;
+ using ReplyArguments = std::tuple<Vector<WebCore::PluginInfo>>;
explicit GetPlugins(bool refresh)
: m_arguments(refresh)
{
@@ -359,7 +362,8 @@
using DelayedReply = CompletionHandler<void(const IPC::Connection::Handle& connectionHandle)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const IPC::Connection::Handle& connectionHandle);
- typedef std::tuple<IPC::Connection::Handle&> Reply;
+ using Reply = std::tuple<IPC::Connection::Handle&>;
+ using ReplyArguments = std::tuple<IPC::Connection::Handle>;
explicit GetPluginProcessConnection(const String& pluginPath)
: m_arguments(pluginPath)
{
@@ -384,7 +388,8 @@
using DelayedReply = CompletionHandler<void()>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&);
- typedef std::tuple<> Reply;
+ using Reply = std::tuple<>;
+ using ReplyArguments = std::tuple<>;
const Arguments& arguments() const
{
return m_arguments;
@@ -493,7 +498,8 @@
static IPC::StringReference name() { return IPC::StringReference("InterpretKeyEvent"); }
static const bool isSync = true;
- typedef std::tuple<Vector<WebCore::KeypressCommand>&> Reply;
+ using Reply = std::tuple<Vector<WebCore::KeypressCommand>&>;
+ using ReplyArguments = std::tuple<Vector<WebCore::KeypressCommand>>;
explicit InterpretKeyEvent(uint32_t type)
: m_arguments(type)
{
Modified: trunk/Source/WebKit/Scripts/webkit/Messages-expected.h (243459 => 243460)
--- trunk/Source/WebKit/Scripts/webkit/Messages-expected.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Scripts/webkit/Messages-expected.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -288,7 +288,8 @@
static IPC::StringReference name() { return IPC::StringReference("CreatePlugin"); }
static const bool isSync = true;
- typedef std::tuple<bool&> Reply;
+ using Reply = std::tuple<bool&>;
+ using ReplyArguments = std::tuple<bool>;
CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters)
: m_arguments(pluginInstanceID, parameters)
{
@@ -311,7 +312,8 @@
static IPC::StringReference name() { return IPC::StringReference("RunJavaScriptAlert"); }
static const bool isSync = true;
- typedef std::tuple<> Reply;
+ using Reply = std::tuple<>;
+ using ReplyArguments = std::tuple<>;
RunJavaScriptAlert(uint64_t frameID, const String& message)
: m_arguments(frameID, message)
{
@@ -334,7 +336,8 @@
static IPC::StringReference name() { return IPC::StringReference("GetPlugins"); }
static const bool isSync = true;
- typedef std::tuple<Vector<WebCore::PluginInfo>&> Reply;
+ using Reply = std::tuple<Vector<WebCore::PluginInfo>&>;
+ using ReplyArguments = std::tuple<Vector<WebCore::PluginInfo>>;
explicit GetPlugins(bool refresh)
: m_arguments(refresh)
{
@@ -359,7 +362,8 @@
using DelayedReply = CompletionHandler<void(const IPC::Connection::Handle& connectionHandle)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const IPC::Connection::Handle& connectionHandle);
- typedef std::tuple<IPC::Connection::Handle&> Reply;
+ using Reply = std::tuple<IPC::Connection::Handle&>;
+ using ReplyArguments = std::tuple<IPC::Connection::Handle>;
explicit GetPluginProcessConnection(const String& pluginPath)
: m_arguments(pluginPath)
{
@@ -384,7 +388,8 @@
using DelayedReply = CompletionHandler<void()>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&);
- typedef std::tuple<> Reply;
+ using Reply = std::tuple<>;
+ using ReplyArguments = std::tuple<>;
const Arguments& arguments() const
{
return m_arguments;
@@ -493,7 +498,8 @@
static IPC::StringReference name() { return IPC::StringReference("InterpretKeyEvent"); }
static const bool isSync = true;
- typedef std::tuple<Vector<WebCore::KeypressCommand>&> Reply;
+ using Reply = std::tuple<Vector<WebCore::KeypressCommand>&>;
+ using ReplyArguments = std::tuple<Vector<WebCore::KeypressCommand>>;
explicit InterpretKeyEvent(uint32_t type)
: m_arguments(type)
{
Modified: trunk/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h (243459 => 243460)
--- trunk/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -80,7 +80,8 @@
static IPC::StringReference asyncMessageReplyName() { return { "TestAsyncMessageReply" }; }
using AsyncReply = CompletionHandler<void(uint64_t result)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t result);
- typedef std::tuple<uint64_t&> Reply;
+ using Reply = std::tuple<uint64_t&>;
+ using ReplyArguments = std::tuple<uint64_t>;
explicit TestAsyncMessage(WebKit::TestTwoStateEnum twoStateEnum)
: m_arguments(twoStateEnum)
{
@@ -110,7 +111,8 @@
static IPC::StringReference asyncMessageReplyName() { return { "TestAsyncMessageWithNoArgumentsReply" }; }
using AsyncReply = CompletionHandler<void()>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&);
- typedef std::tuple<> Reply;
+ using Reply = std::tuple<>;
+ using ReplyArguments = std::tuple<>;
const Arguments& arguments() const
{
return m_arguments;
@@ -135,7 +137,8 @@
static IPC::StringReference asyncMessageReplyName() { return { "TestAsyncMessageWithMultipleArgumentsReply" }; }
using AsyncReply = CompletionHandler<void(bool flag, uint64_t value)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, bool flag, uint64_t value);
- typedef std::tuple<bool&, uint64_t&> Reply;
+ using Reply = std::tuple<bool&, uint64_t&>;
+ using ReplyArguments = std::tuple<bool, uint64_t>;
const Arguments& arguments() const
{
return m_arguments;
@@ -156,7 +159,8 @@
using DelayedReply = CompletionHandler<void(uint8_t reply)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint8_t reply);
- typedef std::tuple<uint8_t&> Reply;
+ using Reply = std::tuple<uint8_t&>;
+ using ReplyArguments = std::tuple<uint8_t>;
explicit TestSyncMessage(uint32_t param)
: m_arguments(param)
{
@@ -181,7 +185,8 @@
using DelayedReply = CompletionHandler<void(const Optional<WebKit::TestClassName>& optionalReply)>;
static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Optional<WebKit::TestClassName>& optionalReply);
- typedef std::tuple<Optional<WebKit::TestClassName>&> Reply;
+ using Reply = std::tuple<Optional<WebKit::TestClassName>&>;
+ using ReplyArguments = std::tuple<Optional<WebKit::TestClassName>>;
explicit TestSynchronousMessage(bool value)
: m_arguments(value)
{
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (243459 => 243460)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2019-03-25 21:23:15 UTC (rev 243460)
@@ -109,6 +109,10 @@
return 'std::tuple<%s>' % (', '.join(reply_parameter_type(parameter.type) for parameter in message.reply_parameters))
+def reply_arguments_type(message):
+ return 'std::tuple<%s>' % (', '.join(parameter.type for parameter in message.reply_parameters))
+
+
def message_to_struct_declaration(message):
result = []
function_parameters = [(function_parameter_type(x.type, x.kind), x.name) for x in message.parameters]
@@ -137,7 +141,8 @@
if len(send_parameters):
result.append(', %s' % completion_handler_parameters)
result.append(');\n')
- result.append(' typedef %s Reply;\n' % reply_type(message))
+ result.append(' using Reply = %s;\n' % reply_type(message))
+ result.append(' using ReplyArguments = %s;\n' % reply_arguments_type(message))
if len(function_parameters):
result.append(' %s%s(%s)' % (len(function_parameters) == 1 and 'explicit ' or '', message.name, ', '.join([' '.join(x) for x in function_parameters])))
Modified: trunk/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -50,6 +50,9 @@
, m_handles(WTFMove(handles))
{
}
+
+ WebIDBResult(WebIDBResult&&) = default;
+ WebIDBResult& operator=(WebIDBResult&&) = default;
const WebCore::IDBResultData& resultData() const { return m_resultData; }
const SandboxExtension::HandleArray& handles() const { return m_handles; }
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -50,8 +50,6 @@
namespace WebKit {
-class PlatformCALayerRemote;
-
class RemoteLayerTreeTransaction {
public:
enum LayerChange {
@@ -177,6 +175,8 @@
explicit RemoteLayerTreeTransaction();
~RemoteLayerTreeTransaction();
+ RemoteLayerTreeTransaction(RemoteLayerTreeTransaction&&);
+ RemoteLayerTreeTransaction& operator=(RemoteLayerTreeTransaction&&);
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, RemoteLayerTreeTransaction&);
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm (243459 => 243460)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm 2019-03-25 21:23:15 UTC (rev 243460)
@@ -39,6 +39,9 @@
namespace WebKit {
+RemoteLayerTreeTransaction::RemoteLayerTreeTransaction(RemoteLayerTreeTransaction&&) = default;
+RemoteLayerTreeTransaction& RemoteLayerTreeTransaction::operator=(RemoteLayerTreeTransaction&&) = default;
+
RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties()
: layerID(0)
, type(WebCore::PlatformCALayer::LayerTypeLayer)
Modified: trunk/Source/WebKit/Shared/ShareableBitmap.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/ShareableBitmap.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/ShareableBitmap.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -63,6 +63,8 @@
WTF_MAKE_NONCOPYABLE(Handle);
public:
Handle();
+ Handle(Handle&&) = default;
+ Handle& operator=(Handle&&) = default;
bool isNull() const { return m_handle.isNull(); }
Modified: trunk/Source/WebKit/Shared/ShareableResource.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/ShareableResource.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/ShareableResource.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -45,6 +45,8 @@
WTF_MAKE_NONCOPYABLE(Handle);
public:
Handle();
+ Handle(Handle&&) = default;
+ Handle& operator=(Handle&&) = default;
bool isNull() const { return m_handle.isNull(); }
unsigned size() const { return m_size; }
Modified: trunk/Source/WebKit/Shared/UpdateInfo.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/UpdateInfo.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/UpdateInfo.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -43,6 +43,8 @@
public:
UpdateInfo() { }
+ UpdateInfo(UpdateInfo&&) = default;
+ UpdateInfo& operator=(UpdateInfo&&) = default;
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, UpdateInfo&);
Modified: trunk/Source/WebKit/Shared/WebEvent.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/WebEvent.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/WebEvent.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -24,8 +24,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebEvent_h
-#define WebEvent_h
+#pragma once
// FIXME: We should probably move to makeing the WebCore/PlatformFooEvents trivial classes so that
// we can use them as the event type.
@@ -34,6 +33,7 @@
#include <WebCore/FloatSize.h>
#include <WebCore/IntPoint.h>
#include <WebCore/IntSize.h>
+#include <WebCore/KeypressCommand.h>
#include <wtf/OptionSet.h>
#include <wtf/WallTime.h>
#include <wtf/text/WTFString.h>
@@ -497,5 +497,3 @@
#endif // ENABLE(TOUCH_EVENTS)
} // namespace WebKit
-
-#endif // WebEvent_h
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (243459 => 243460)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2019-03-25 21:23:15 UTC (rev 243460)
@@ -34,6 +34,9 @@
namespace WebKit {
+WebProcessCreationParameters::WebProcessCreationParameters(WebProcessCreationParameters&&) = default;
+WebProcessCreationParameters& WebProcessCreationParameters::operator=(WebProcessCreationParameters&&) = default;
+
WebProcessCreationParameters::WebProcessCreationParameters()
{
}
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -65,6 +65,8 @@
struct WebProcessCreationParameters {
WebProcessCreationParameters();
~WebProcessCreationParameters();
+ WebProcessCreationParameters(WebProcessCreationParameters&&);
+ WebProcessCreationParameters& operator=(WebProcessCreationParameters&&);
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, WebProcessCreationParameters&);
Modified: trunk/Source/WebKit/Shared/mac/SecItemResponseData.cpp (243459 => 243460)
--- trunk/Source/WebKit/Shared/mac/SecItemResponseData.cpp 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/mac/SecItemResponseData.cpp 2019-03-25 21:23:15 UTC (rev 243460)
@@ -31,13 +31,9 @@
namespace WebKit {
-SecItemResponseData::SecItemResponseData()
-{
-}
-
-SecItemResponseData::SecItemResponseData(OSStatus resultCode, CFTypeRef resultObject)
+SecItemResponseData::SecItemResponseData(OSStatus resultCode, RetainPtr<CFTypeRef>&& resultObject)
: m_resultObject(resultObject)
- , m_resultCode(resultCode)
+ , m_resultCode(WTFMove(resultCode))
{
}
@@ -49,22 +45,21 @@
IPC::encode(encoder, m_resultObject.get());
}
-bool SecItemResponseData::decode(IPC::Decoder& decoder, SecItemResponseData& secItemResponseData)
+Optional<SecItemResponseData> SecItemResponseData::decode(IPC::Decoder& decoder)
{
int64_t resultCode;
if (!decoder.decode(resultCode))
- return false;
- secItemResponseData.m_resultCode = (OSStatus)resultCode;
- secItemResponseData.m_resultObject = 0;
+ return WTF::nullopt;
bool expectResultObject;
if (!decoder.decode(expectResultObject))
- return false;
+ return WTF::nullopt;
- if (expectResultObject && !IPC::decode(decoder, secItemResponseData.m_resultObject))
- return false;
+ RetainPtr<CFTypeRef> result;
+ if (expectResultObject && !IPC::decode(decoder, result))
+ return WTF::nullopt;
- return true;
+ return {{ static_cast<OSStatus>(resultCode), WTFMove(result) }};
}
} // namespace WebKit
Modified: trunk/Source/WebKit/Shared/mac/SecItemResponseData.h (243459 => 243460)
--- trunk/Source/WebKit/Shared/mac/SecItemResponseData.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/Shared/mac/SecItemResponseData.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -37,11 +37,10 @@
class SecItemResponseData {
public:
- SecItemResponseData();
- SecItemResponseData(OSStatus, CFTypeRef result);
+ SecItemResponseData(OSStatus, RetainPtr<CFTypeRef>&& result);
void encode(IPC::Encoder&) const;
- static bool decode(IPC::Decoder&, SecItemResponseData&);
+ static Optional<SecItemResponseData> decode(IPC::Decoder&);
RetainPtr<CFTypeRef>& resultObject() { return m_resultObject; }
OSStatus resultCode() const { return m_resultCode; }
Modified: trunk/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.h (243459 => 243460)
--- trunk/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.h 2019-03-25 21:21:50 UTC (rev 243459)
+++ trunk/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.h 2019-03-25 21:23:15 UTC (rev 243460)
@@ -39,6 +39,8 @@
MediaDeviceSandboxExtensions()
{
}
+ MediaDeviceSandboxExtensions(MediaDeviceSandboxExtensions&&) = default;
+ MediaDeviceSandboxExtensions& operator=(MediaDeviceSandboxExtensions&&) = default;
MediaDeviceSandboxExtensions(Vector<String> ids, SandboxExtension::HandleArray&& handles);