Changeset 243460 in webkit
- Timestamp:
- Mar 25, 2019 2:23:15 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243459 r243460 1 2019-03-25 Alex Christensen <achristensen@webkit.org> 2 3 Enable IPC sending and receiving non-default-constructible types 4 https://bugs.webkit.org/show_bug.cgi?id=196132 5 6 Reviewed by Geoff Garen. 7 8 This basically just requires the decoding of std::tuple to return an Optional<std::tuple> instead of 9 constructing a std::tuple then decoding into it. I now decode synchronous replies into an Optional<std::tuple> 10 then move it into the tuple of references where the successfully decoded reply should go. This required 11 the synchronous reply types be move constructible and move assignable. 12 13 * Modules/indexeddb/shared/IDBRequestData.h: 14 * Modules/indexeddb/shared/IDBTransactionInfo.h: 15 * platform/DragImage.h: 16 * platform/PasteboardWriterData.h: 17 * platform/audio/mac/CAAudioStreamDescription.h: 18 * platform/graphics/RemoteVideoSample.h: 19 1 20 2019-03-25 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h
r239427 r243460 51 51 explicit IDBRequestData(IDBClient::TransactionOperation&); 52 52 IDBRequestData(const IDBRequestData&); 53 IDBRequestData(IDBRequestData&&) = default; 54 IDBRequestData& operator=(IDBRequestData&&) = default; 53 55 54 56 enum IsolatedCopyTag { IsolatedCopy }; -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h
r241183 r243460 51 51 52 52 IDBTransactionInfo(const IDBTransactionInfo&); 53 IDBTransactionInfo(IDBTransactionInfo&&) = default; 54 IDBTransactionInfo& operator=(IDBTransactionInfo&&) = default; 53 55 54 56 enum IsolatedCopyTag { IsolatedCopy }; -
trunk/Source/WebCore/platform/DragImage.h
r239427 r243460 103 103 WEBCORE_EXPORT DragImage(); 104 104 explicit DragImage(DragImageRef); 105 DragImage(DragImage&&);105 WEBCORE_EXPORT DragImage(DragImage&&); 106 106 WEBCORE_EXPORT ~DragImage(); 107 107 108 DragImage& operator=(DragImage&&);108 WEBCORE_EXPORT DragImage& operator=(DragImage&&); 109 109 110 110 void setIndicatorData(const TextIndicatorData& data) { m_indicatorData = data; } -
trunk/Source/WebCore/platform/PasteboardWriterData.h
r239427 r243460 48 48 struct WebContent { 49 49 WebContent(); 50 ~WebContent();50 WEBCORE_EXPORT ~WebContent(); 51 51 52 52 #if PLATFORM(COCOA) -
trunk/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h
r241183 r243460 34 34 inline bool operator!=(const AudioStreamBasicDescription& a, const AudioStreamBasicDescription& b) { return !(a == b); } 35 35 36 class CAAudioStreamDescription final : public AudioStreamDescription {36 class WEBCORE_EXPORT CAAudioStreamDescription final : public AudioStreamDescription { 37 37 WTF_MAKE_FAST_ALLOCATED; 38 38 39 39 public: 40 40 41 WEBCORE_EXPORTCAAudioStreamDescription();42 WEBCORE_EXPORTCAAudioStreamDescription(const AudioStreamBasicDescription&);43 WEBCORE_EXPORTCAAudioStreamDescription(double, uint32_t, PCMFormat, bool);44 WEBCORE_EXPORT~CAAudioStreamDescription();41 CAAudioStreamDescription(); 42 CAAudioStreamDescription(const AudioStreamBasicDescription&); 43 CAAudioStreamDescription(double, uint32_t, PCMFormat, bool); 44 ~CAAudioStreamDescription(); 45 45 46 46 const PlatformDescription& platformDescription() const final; 47 47 48 WEBCORE_EXPORTPCMFormat format() const final;48 PCMFormat format() const final; 49 49 50 50 double sampleRate() const final { return m_streamDescription.mSampleRate; } -
trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h
r237281 r243460 42 42 public: 43 43 RemoteVideoSample() = default; 44 RemoteVideoSample(RemoteVideoSample&&) = default; 45 RemoteVideoSample& operator=(RemoteVideoSample&&) = default; 44 46 ~RemoteVideoSample() = default; 45 47 -
trunk/Source/WebKit/ChangeLog
r243454 r243460 1 2019-03-25 Alex Christensen <achristensen@webkit.org> 2 3 Enable IPC sending and receiving non-default-constructible types 4 https://bugs.webkit.org/show_bug.cgi?id=196132 5 6 Reviewed by Geoff Garen. 7 8 * Platform/IPC/ArgumentCoder.h: 9 * Platform/IPC/ArgumentCoders.h: 10 (IPC::TupleEncoder::encode): 11 (IPC::tupleFromTupleAndObject): 12 (IPC::TupleDecoderImpl::decode): 13 (IPC::TupleDecoderImpl<Type>::decode): 14 (IPC::TupleDecoder::decode): 15 (IPC::TupleDecoder<0>::decode): 16 (IPC::TupleCoder::encode): Deleted. 17 (IPC::TupleCoder::decode): Deleted. 18 * Platform/IPC/Connection.h: 19 (IPC::Connection::sendWithReply): 20 (IPC::TupleMover::move): 21 (IPC::moveTuple): 22 (IPC::Connection::sendSync): 23 * Platform/IPC/Decoder.h: 24 (IPC::Decoder::decode): 25 (IPC::Decoder::operator>>): 26 * Platform/IPC/HandleMessage.h: 27 (IPC::handleMessage): 28 (IPC::handleMessageSynchronous): 29 (IPC::handleMessageSynchronousWantsConnection): 30 (IPC::handleMessageAsync): 31 * Platform/SharedMemory.h: 32 * Scripts/webkit/LegacyMessages-expected.h: 33 * Scripts/webkit/Messages-expected.h: 34 * Scripts/webkit/MessagesSuperclass-expected.h: 35 * Scripts/webkit/messages.py: 36 * Shared/Databases/IndexedDB/WebIDBResult.h: 37 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: 38 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: 39 * Shared/ShareableBitmap.h: 40 * Shared/ShareableResource.h: 41 * Shared/UpdateInfo.h: 42 * Shared/WebEvent.h: 43 * Shared/WebProcessCreationParameters.cpp: 44 * Shared/WebProcessCreationParameters.h: 45 * Shared/mac/SecItemResponseData.cpp: 46 (WebKit::SecItemResponseData::SecItemResponseData): 47 (WebKit::SecItemResponseData::decode): 48 * Shared/mac/SecItemResponseData.h: 49 * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: 50 1 51 2019-03-25 Tim Horton <timothy_horton@apple.com> 2 52 -
trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h
r239427 r243460 42 42 template<typename> struct ArgumentCoder; 43 43 44 template<typename> class UsesModernDecoder; 45 44 46 template<typename U> 45 47 class UsesModernDecoder { … … 53 55 static constexpr bool argumentCoderValue = sizeof(check<U>(nullptr)) == sizeof(uint8_t); 54 56 static constexpr bool value = argumentCoderValue || sizeof(checkArgumentCoder<U>(nullptr)) == sizeof(uint8_t); 57 }; 58 59 template<typename... Types> 60 class UsesModernDecoder<std::tuple<Types...>> { 61 public: 62 static constexpr bool value = true; 63 static constexpr bool argumentCoderValue = true; 55 64 }; 56 65 -
trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h
r243163 r243460 161 161 162 162 template<size_t index, typename... Elements> 163 struct Tuple Coder {163 struct TupleEncoder { 164 164 static void encode(Encoder& encoder, const std::tuple<Elements...>& tuple) 165 165 { 166 166 encoder << std::get<sizeof...(Elements) - index>(tuple); 167 TupleCoder<index - 1, Elements...>::encode(encoder, tuple); 168 } 169 170 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> 171 static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple) 172 { 173 if (!decoder.decode(std::get<sizeof...(Elements) - index>(tuple))) 174 return false; 175 return TupleCoder<index - 1, Elements...>::decode(decoder, tuple); 176 } 177 178 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> 179 static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple) 180 { 181 Optional<U> optional; 167 TupleEncoder<index - 1, Elements...>::encode(encoder, tuple); 168 } 169 }; 170 171 template<typename... Elements> 172 struct TupleEncoder<0, Elements...> { 173 static void encode(Encoder&, const std::tuple<Elements...>&) 174 { 175 } 176 }; 177 178 template <typename T, typename... Elements, size_t... Indices> 179 auto tupleFromTupleAndObject(T&& object, std::tuple<Elements...>&& tuple, std::index_sequence<Indices...>) 180 { 181 return std::make_tuple(WTFMove(object), WTFMove(std::get<Indices>(tuple))...); 182 } 183 184 template <typename T, typename... Elements> 185 auto tupleFromTupleAndObject(T&& object, std::tuple<Elements...>&& tuple) 186 { 187 return tupleFromTupleAndObject(WTFMove(object), WTFMove(tuple), std::index_sequence_for<Elements...>()); 188 } 189 190 template<typename Type, typename... Types> 191 struct TupleDecoderImpl { 192 static Optional<std::tuple<Type, Types...>> decode(Decoder& decoder) 193 { 194 Optional<Type> optional; 182 195 decoder >> optional; 183 196 if (!optional) 184 return false; 185 std::get<sizeof...(Elements) - index>(tuple) = WTFMove(*optional); 186 return TupleCoder<index - 1, Elements...>::decode(decoder, tuple); 187 } 188 }; 189 190 template<typename... Elements> 191 struct TupleCoder<0, Elements...> { 192 static void encode(Encoder&, const std::tuple<Elements...>&) 193 { 194 } 195 196 static bool decode(Decoder&, std::tuple<Elements...>&) 197 { 198 return true; 197 return WTF::nullopt; 198 199 Optional<std::tuple<Types...>> subTuple = TupleDecoderImpl<Types...>::decode(decoder); 200 if (!subTuple) 201 return WTF::nullopt; 202 203 return tupleFromTupleAndObject(WTFMove(*optional), WTFMove(*subTuple)); 204 } 205 }; 206 207 template<typename Type> 208 struct TupleDecoderImpl<Type> { 209 static Optional<std::tuple<Type>> decode(Decoder& decoder) 210 { 211 Optional<Type> optional; 212 decoder >> optional; 213 if (!optional) 214 return WTF::nullopt; 215 return std::make_tuple(WTFMove(*optional)); 216 } 217 }; 218 219 template<size_t size, typename... Elements> 220 struct TupleDecoder { 221 static Optional<std::tuple<Elements...>> decode(Decoder& decoder) 222 { 223 return TupleDecoderImpl<Elements...>::decode(decoder); 224 } 225 }; 226 227 template<> 228 struct TupleDecoder<0> { 229 static Optional<std::tuple<>> decode(Decoder& decoder) 230 { 231 return std::make_tuple(); 199 232 } 200 233 }; … … 203 236 static void encode(Encoder& encoder, const std::tuple<Elements...>& tuple) 204 237 { 205 TupleCoder<sizeof...(Elements), Elements...>::encode(encoder, tuple); 206 } 207 208 static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple) 209 { 210 return TupleCoder<sizeof...(Elements), Elements...>::decode(decoder, tuple); 211 } 212 }; 213 238 TupleEncoder<sizeof...(Elements), Elements...>::encode(encoder, tuple); 239 } 240 241 static Optional<std::tuple<Elements...>> decode(Decoder& decoder) 242 { 243 return TupleDecoder<sizeof...(Elements), Elements...>::decode(decoder); 244 } 245 }; 214 246 215 247 template<typename KeyType, typename ValueType> struct ArgumentCoder<WTF::KeyValuePair<KeyType, ValueType>> { -
trunk/Source/WebKit/Platform/IPC/Connection.h
r241183 r243460 445 445 sendMessageWithReply(requestID, WTFMove(encoder), replyDispatcher, [replyHandler = WTFMove(replyHandler)](std::unique_ptr<Decoder> decoder) { 446 446 if (decoder) { 447 typename CodingType<typename T::Reply>::Type reply; 448 if (decoder->decode(reply)) { 449 replyHandler(WTFMove(reply)); 447 Optional<typename CodingType<typename T::Reply>::Type> reply; 448 *decoder >> reply; 449 if (reply) { 450 replyHandler(WTFMove(*reply)); 450 451 return; 451 452 } … … 454 455 replyHandler(WTF::nullopt); 455 456 }); 457 } 458 459 template<size_t i, typename A, typename B> struct TupleMover { 460 static void move(A&& a, B& b) 461 { 462 std::get<i - 1>(b) = WTFMove(std::get<i - 1>(a)); 463 TupleMover<i - 1, A, B>::move(WTFMove(a), b); 464 } 465 }; 466 467 template<typename A, typename B> struct TupleMover<0, A, B> { 468 static void move(A&&, B&) { } 469 }; 470 471 template<typename... A, typename... B> 472 void moveTuple(std::tuple<A...>&& a, std::tuple<B...>& b) 473 { 474 static_assert(sizeof...(A) == sizeof...(B), "Should be used with two tuples of same size"); 475 TupleMover<sizeof...(A), std::tuple<A...>, std::tuple<B...>>::move(WTFMove(a), b); 456 476 } 457 477 … … 477 497 478 498 // Decode the reply. 479 return replyDecoder->decode(reply); 499 Optional<typename T::ReplyArguments> replyArguments; 500 *replyDecoder >> replyArguments; 501 if (!replyArguments) 502 return false; 503 moveTuple(WTFMove(*replyArguments), reply); 504 return true; 480 505 } 481 506 -
trunk/Source/WebKit/Platform/IPC/Decoder.h
r239427 r243460 151 151 } 152 152 153 template<typename T, std::enable_if_t<!std::is_enum<T>::value && !UsesLegacyDecoder<T>::value>* = nullptr> 154 bool decode(T& t) 155 { 156 Optional<T> optional; 157 *this >> optional; 158 if (!optional) 159 return false; 160 t = WTFMove(*optional); 161 return true; 162 } 163 153 164 template<typename T, std::enable_if_t<UsesModernDecoder<T>::value>* = nullptr> 154 165 Decoder& operator>>(Optional<T>& t) 155 166 { 156 167 t = ArgumentCoder<T>::decode(*this); 168 return *this; 169 } 170 171 template<typename T, std::enable_if_t<!std::is_enum<T>::value && !UsesModernDecoder<T>::value>* = nullptr> 172 Decoder& operator>>(Optional<T>& optional) 173 { 174 T t; 175 if (ArgumentCoder<T>::decode(*this, t)) { 176 optional = WTFMove(t); 177 return *this; 178 } 179 optional = WTF::nullopt; 157 180 return *this; 158 181 } -
trunk/Source/WebKit/Platform/IPC/HandleMessage.h
r243345 r243460 111 111 void handleMessage(Decoder& decoder, C* object, MF function) 112 112 { 113 typename CodingType<typename T::Arguments>::Type arguments; 114 if (!decoder.decode(arguments)) { 113 Optional<typename CodingType<typename T::Arguments>::Type> arguments; 114 decoder >> arguments; 115 if (!arguments) { 115 116 ASSERT(decoder.isInvalid()); 116 117 return; 117 118 } 118 119 119 callMemberFunction(WTFMove( arguments), object, function);120 callMemberFunction(WTFMove(*arguments), object, function); 120 121 } 121 122 … … 123 124 void handleMessage(Connection& connection, Decoder& decoder, C* object, MF function) 124 125 { 125 typename CodingType<typename T::Arguments>::Type arguments; 126 if (!decoder.decode(arguments)) { 126 Optional<typename CodingType<typename T::Arguments>::Type> arguments; 127 decoder >> arguments; 128 if (!arguments) { 127 129 ASSERT(decoder.isInvalid()); 128 130 return; 129 131 } 130 callMemberFunction(connection, WTFMove( arguments), object, function);132 callMemberFunction(connection, WTFMove(*arguments), object, function); 131 133 } 132 134 … … 134 136 void handleMessageSynchronous(Connection& connection, Decoder& decoder, std::unique_ptr<Encoder>& replyEncoder, C* object, MF function) 135 137 { 136 typename CodingType<typename T::Arguments>::Type arguments; 137 if (!decoder.decode(arguments)) { 138 Optional<typename CodingType<typename T::Arguments>::Type> arguments; 139 decoder >> arguments; 140 if (!arguments) { 138 141 ASSERT(decoder.isInvalid()); 139 142 return; … … 143 146 T::send(WTFMove(replyEncoder), WTFMove(connection), args...); 144 147 }; 145 callMemberFunction(WTFMove( arguments), WTFMove(completionHandler), object, function);148 callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function); 146 149 } 147 150 … … 149 152 void handleMessageSynchronousWantsConnection(Connection& connection, Decoder& decoder, std::unique_ptr<Encoder>& replyEncoder, C* object, MF function) 150 153 { 151 typename CodingType<typename T::Arguments>::Type arguments; 152 if (!decoder.decode(arguments)) { 154 Optional<typename CodingType<typename T::Arguments>::Type> arguments; 155 decoder >> arguments; 156 if (!arguments) { 153 157 ASSERT(decoder.isInvalid()); 154 158 return; … … 158 162 T::send(WTFMove(replyEncoder), WTFMove(connection), args...); 159 163 }; 160 callMemberFunction(connection, WTFMove( arguments), WTFMove(completionHandler), object, function);164 callMemberFunction(connection, WTFMove(*arguments), WTFMove(completionHandler), object, function); 161 165 } 162 166 … … 171 175 } 172 176 173 typename CodingType<typename T::Arguments>::Type arguments; 174 if (!decoder.decode(arguments)) { 177 Optional<typename CodingType<typename T::Arguments>::Type> arguments; 178 decoder >> arguments; 179 if (!arguments) { 175 180 ASSERT(decoder.isInvalid()); 176 181 return; … … 182 187 T::send(WTFMove(encoder), WTFMove(connection), args...); 183 188 }; 184 callMemberFunction(WTFMove( arguments), WTFMove(completionHandler), object, function);189 callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function); 185 190 } 186 191 -
trunk/Source/WebKit/Platform/SharedMemory.h
r239427 r243460 65 65 Handle(); 66 66 ~Handle(); 67 Handle(Handle&&); 68 Handle& operator=(Handle&&); 67 69 68 70 bool isNull() const; -
trunk/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp
r239260 r243460 47 47 } 48 48 49 SharedMemory::Handle::Handle(Handle&& other) 50 { 51 m_port = std::exchange(other.m_port, MACH_PORT_NULL); 52 m_size = std::exchange(other.m_size, 0); 53 } 54 55 auto SharedMemory::Handle::operator=(Handle&& other) -> Handle& 56 { 57 m_port = std::exchange(other.m_port, MACH_PORT_NULL); 58 m_size = std::exchange(other.m_size, 0); 59 return *this; 60 } 61 49 62 SharedMemory::Handle::~Handle() 50 63 { -
trunk/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp
r239427 r243460 60 60 } 61 61 62 SharedMemory::Handle::Handle(Handle&&) = default; 63 SharedMemory::Handle& SharedMemory::Handle::operator=(Handle&& other) = default; 64 62 65 void SharedMemory::Handle::clear() 63 66 { -
trunk/Source/WebKit/Platform/win/SharedMemoryWin.cpp
r239261 r243460 40 40 } 41 41 42 SharedMemory::Handle::Handle(Handle&& other) 43 { 44 m_handle = std::exchange(other.m_handle, 0); 45 m_size = std::exchange(other.m_size, 0); 46 } 47 48 auto SharedMemory::Handle::operator=(Handle&& other) -> Handle& 49 { 50 m_handle = std::exchange(other.m_handle, 0); 51 m_size = std::exchange(other.m_size, 0); 52 return *this; 53 } 54 42 55 SharedMemory::Handle::~Handle() 43 56 { -
trunk/Source/WebKit/Scripts/webkit/LegacyMessages-expected.h
r241622 r243460 289 289 static const bool isSync = true; 290 290 291 typedef std::tuple<bool&> Reply; 291 using Reply = std::tuple<bool&>; 292 using ReplyArguments = std::tuple<bool>; 292 293 CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters) 293 294 : m_arguments(pluginInstanceID, parameters) … … 312 313 static const bool isSync = true; 313 314 314 typedef std::tuple<> Reply; 315 using Reply = std::tuple<>; 316 using ReplyArguments = std::tuple<>; 315 317 RunJavaScriptAlert(uint64_t frameID, const String& message) 316 318 : m_arguments(frameID, message) … … 335 337 static const bool isSync = true; 336 338 337 typedef std::tuple<Vector<WebCore::PluginInfo>&> Reply; 339 using Reply = std::tuple<Vector<WebCore::PluginInfo>&>; 340 using ReplyArguments = std::tuple<Vector<WebCore::PluginInfo>>; 338 341 explicit GetPlugins(bool refresh) 339 342 : m_arguments(refresh) … … 360 363 using DelayedReply = CompletionHandler<void(const IPC::Connection::Handle& connectionHandle)>; 361 364 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const IPC::Connection::Handle& connectionHandle); 362 typedef std::tuple<IPC::Connection::Handle&> Reply; 365 using Reply = std::tuple<IPC::Connection::Handle&>; 366 using ReplyArguments = std::tuple<IPC::Connection::Handle>; 363 367 explicit GetPluginProcessConnection(const String& pluginPath) 364 368 : m_arguments(pluginPath) … … 385 389 using DelayedReply = CompletionHandler<void()>; 386 390 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&); 387 typedef std::tuple<> Reply; 391 using Reply = std::tuple<>; 392 using ReplyArguments = std::tuple<>; 388 393 const Arguments& arguments() const 389 394 { … … 494 499 static const bool isSync = true; 495 500 496 typedef std::tuple<Vector<WebCore::KeypressCommand>&> Reply; 501 using Reply = std::tuple<Vector<WebCore::KeypressCommand>&>; 502 using ReplyArguments = std::tuple<Vector<WebCore::KeypressCommand>>; 497 503 explicit InterpretKeyEvent(uint32_t type) 498 504 : m_arguments(type) -
trunk/Source/WebKit/Scripts/webkit/Messages-expected.h
r241622 r243460 289 289 static const bool isSync = true; 290 290 291 typedef std::tuple<bool&> Reply; 291 using Reply = std::tuple<bool&>; 292 using ReplyArguments = std::tuple<bool>; 292 293 CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters) 293 294 : m_arguments(pluginInstanceID, parameters) … … 312 313 static const bool isSync = true; 313 314 314 typedef std::tuple<> Reply; 315 using Reply = std::tuple<>; 316 using ReplyArguments = std::tuple<>; 315 317 RunJavaScriptAlert(uint64_t frameID, const String& message) 316 318 : m_arguments(frameID, message) … … 335 337 static const bool isSync = true; 336 338 337 typedef std::tuple<Vector<WebCore::PluginInfo>&> Reply; 339 using Reply = std::tuple<Vector<WebCore::PluginInfo>&>; 340 using ReplyArguments = std::tuple<Vector<WebCore::PluginInfo>>; 338 341 explicit GetPlugins(bool refresh) 339 342 : m_arguments(refresh) … … 360 363 using DelayedReply = CompletionHandler<void(const IPC::Connection::Handle& connectionHandle)>; 361 364 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const IPC::Connection::Handle& connectionHandle); 362 typedef std::tuple<IPC::Connection::Handle&> Reply; 365 using Reply = std::tuple<IPC::Connection::Handle&>; 366 using ReplyArguments = std::tuple<IPC::Connection::Handle>; 363 367 explicit GetPluginProcessConnection(const String& pluginPath) 364 368 : m_arguments(pluginPath) … … 385 389 using DelayedReply = CompletionHandler<void()>; 386 390 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&); 387 typedef std::tuple<> Reply; 391 using Reply = std::tuple<>; 392 using ReplyArguments = std::tuple<>; 388 393 const Arguments& arguments() const 389 394 { … … 494 499 static const bool isSync = true; 495 500 496 typedef std::tuple<Vector<WebCore::KeypressCommand>&> Reply; 501 using Reply = std::tuple<Vector<WebCore::KeypressCommand>&>; 502 using ReplyArguments = std::tuple<Vector<WebCore::KeypressCommand>>; 497 503 explicit InterpretKeyEvent(uint32_t type) 498 504 : m_arguments(type) -
trunk/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h
r243345 r243460 81 81 using AsyncReply = CompletionHandler<void(uint64_t result)>; 82 82 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t result); 83 typedef std::tuple<uint64_t&> Reply; 83 using Reply = std::tuple<uint64_t&>; 84 using ReplyArguments = std::tuple<uint64_t>; 84 85 explicit TestAsyncMessage(WebKit::TestTwoStateEnum twoStateEnum) 85 86 : m_arguments(twoStateEnum) … … 111 112 using AsyncReply = CompletionHandler<void()>; 112 113 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&); 113 typedef std::tuple<> Reply; 114 using Reply = std::tuple<>; 115 using ReplyArguments = std::tuple<>; 114 116 const Arguments& arguments() const 115 117 { … … 136 138 using AsyncReply = CompletionHandler<void(bool flag, uint64_t value)>; 137 139 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, bool flag, uint64_t value); 138 typedef std::tuple<bool&, uint64_t&> Reply; 140 using Reply = std::tuple<bool&, uint64_t&>; 141 using ReplyArguments = std::tuple<bool, uint64_t>; 139 142 const Arguments& arguments() const 140 143 { … … 157 160 using DelayedReply = CompletionHandler<void(uint8_t reply)>; 158 161 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint8_t reply); 159 typedef std::tuple<uint8_t&> Reply; 162 using Reply = std::tuple<uint8_t&>; 163 using ReplyArguments = std::tuple<uint8_t>; 160 164 explicit TestSyncMessage(uint32_t param) 161 165 : m_arguments(param) … … 182 186 using DelayedReply = CompletionHandler<void(const Optional<WebKit::TestClassName>& optionalReply)>; 183 187 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Optional<WebKit::TestClassName>& optionalReply); 184 typedef std::tuple<Optional<WebKit::TestClassName>&> Reply; 188 using Reply = std::tuple<Optional<WebKit::TestClassName>&>; 189 using ReplyArguments = std::tuple<Optional<WebKit::TestClassName>>; 185 190 explicit TestSynchronousMessage(bool value) 186 191 : m_arguments(value) -
trunk/Source/WebKit/Scripts/webkit/messages.py
r243354 r243460 110 110 111 111 112 def reply_arguments_type(message): 113 return 'std::tuple<%s>' % (', '.join(parameter.type for parameter in message.reply_parameters)) 114 115 112 116 def message_to_struct_declaration(message): 113 117 result = [] … … 138 142 result.append(', %s' % completion_handler_parameters) 139 143 result.append(');\n') 140 result.append(' typedef %s Reply;\n' % reply_type(message)) 144 result.append(' using Reply = %s;\n' % reply_type(message)) 145 result.append(' using ReplyArguments = %s;\n' % reply_arguments_type(message)) 141 146 142 147 if len(function_parameters): -
trunk/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.h
r204668 r243460 51 51 { 52 52 } 53 54 WebIDBResult(WebIDBResult&&) = default; 55 WebIDBResult& operator=(WebIDBResult&&) = default; 53 56 54 57 const WebCore::IDBResultData& resultData() const { return m_resultData; } -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
r243007 r243460 50 50 51 51 namespace WebKit { 52 53 class PlatformCALayerRemote;54 52 55 53 class RemoteLayerTreeTransaction { … … 178 176 explicit RemoteLayerTreeTransaction(); 179 177 ~RemoteLayerTreeTransaction(); 178 RemoteLayerTreeTransaction(RemoteLayerTreeTransaction&&); 179 RemoteLayerTreeTransaction& operator=(RemoteLayerTreeTransaction&&); 180 180 181 181 void encode(IPC::Encoder&) const; -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
r243007 r243460 39 39 40 40 namespace WebKit { 41 42 RemoteLayerTreeTransaction::RemoteLayerTreeTransaction(RemoteLayerTreeTransaction&&) = default; 43 RemoteLayerTreeTransaction& RemoteLayerTreeTransaction::operator=(RemoteLayerTreeTransaction&&) = default; 41 44 42 45 RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties() -
trunk/Source/WebKit/Shared/ShareableBitmap.h
r221149 r243460 64 64 public: 65 65 Handle(); 66 Handle(Handle&&) = default; 67 Handle& operator=(Handle&&) = default; 66 68 67 69 bool isNull() const { return m_handle.isNull(); } -
trunk/Source/WebKit/Shared/ShareableResource.h
r204668 r243460 46 46 public: 47 47 Handle(); 48 Handle(Handle&&) = default; 49 Handle& operator=(Handle&&) = default; 48 50 49 51 bool isNull() const { return m_handle.isNull(); } -
trunk/Source/WebKit/Shared/UpdateInfo.h
r204668 r243460 44 44 public: 45 45 UpdateInfo() { } 46 UpdateInfo(UpdateInfo&&) = default; 47 UpdateInfo& operator=(UpdateInfo&&) = default; 46 48 47 49 void encode(IPC::Encoder&) const; -
trunk/Source/WebKit/Shared/WebEvent.h
r241183 r243460 25 25 */ 26 26 27 #ifndef WebEvent_h 28 #define WebEvent_h 27 #pragma once 29 28 30 29 // FIXME: We should probably move to makeing the WebCore/PlatformFooEvents trivial classes so that … … 35 34 #include <WebCore/IntPoint.h> 36 35 #include <WebCore/IntSize.h> 36 #include <WebCore/KeypressCommand.h> 37 37 #include <wtf/OptionSet.h> 38 38 #include <wtf/WallTime.h> … … 498 498 499 499 } // namespace WebKit 500 501 #endif // WebEvent_h -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp
r243384 r243460 35 35 namespace WebKit { 36 36 37 WebProcessCreationParameters::WebProcessCreationParameters(WebProcessCreationParameters&&) = default; 38 WebProcessCreationParameters& WebProcessCreationParameters::operator=(WebProcessCreationParameters&&) = default; 39 37 40 WebProcessCreationParameters::WebProcessCreationParameters() 38 41 { -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.h
r243384 r243460 66 66 WebProcessCreationParameters(); 67 67 ~WebProcessCreationParameters(); 68 WebProcessCreationParameters(WebProcessCreationParameters&&); 69 WebProcessCreationParameters& operator=(WebProcessCreationParameters&&); 68 70 69 71 void encode(IPC::Encoder&) const; -
trunk/Source/WebKit/Shared/mac/SecItemResponseData.cpp
r204668 r243460 32 32 namespace WebKit { 33 33 34 SecItemResponseData::SecItemResponseData() 35 { 36 } 37 38 SecItemResponseData::SecItemResponseData(OSStatus resultCode, CFTypeRef resultObject) 34 SecItemResponseData::SecItemResponseData(OSStatus resultCode, RetainPtr<CFTypeRef>&& resultObject) 39 35 : m_resultObject(resultObject) 40 , m_resultCode( resultCode)36 , m_resultCode(WTFMove(resultCode)) 41 37 { 42 38 } … … 50 46 } 51 47 52 bool SecItemResponseData::decode(IPC::Decoder& decoder, SecItemResponseData& secItemResponseData)48 Optional<SecItemResponseData> SecItemResponseData::decode(IPC::Decoder& decoder) 53 49 { 54 50 int64_t resultCode; 55 51 if (!decoder.decode(resultCode)) 56 return false; 57 secItemResponseData.m_resultCode = (OSStatus)resultCode; 58 secItemResponseData.m_resultObject = 0; 52 return WTF::nullopt; 59 53 60 54 bool expectResultObject; 61 55 if (!decoder.decode(expectResultObject)) 62 return false;56 return WTF::nullopt; 63 57 64 if (expectResultObject && !IPC::decode(decoder, secItemResponseData.m_resultObject)) 65 return false; 58 RetainPtr<CFTypeRef> result; 59 if (expectResultObject && !IPC::decode(decoder, result)) 60 return WTF::nullopt; 66 61 67 return true;62 return {{ static_cast<OSStatus>(resultCode), WTFMove(result) }}; 68 63 } 69 64 -
trunk/Source/WebKit/Shared/mac/SecItemResponseData.h
r204668 r243460 38 38 class SecItemResponseData { 39 39 public: 40 SecItemResponseData(); 41 SecItemResponseData(OSStatus, CFTypeRef result); 40 SecItemResponseData(OSStatus, RetainPtr<CFTypeRef>&& result); 42 41 43 42 void encode(IPC::Encoder&) const; 44 static bool decode(IPC::Decoder&, SecItemResponseData&);43 static Optional<SecItemResponseData> decode(IPC::Decoder&); 45 44 46 45 RetainPtr<CFTypeRef>& resultObject() { return m_resultObject; } -
trunk/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.h
r225926 r243460 40 40 { 41 41 } 42 MediaDeviceSandboxExtensions(MediaDeviceSandboxExtensions&&) = default; 43 MediaDeviceSandboxExtensions& operator=(MediaDeviceSandboxExtensions&&) = default; 42 44 43 45 MediaDeviceSandboxExtensions(Vector<String> ids, SandboxExtension::HandleArray&& handles);
Note: See TracChangeset
for help on using the changeset viewer.