|
Lines 179-190
public:
Source/WebKit/Platform/IPC/Connection.h_sec1
|
| 179 |
|
179 |
|
| 180 |
template<typename T, typename C> void sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID = 0); |
180 |
template<typename T, typename C> void sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID = 0); |
| 181 |
template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { }); |
181 |
template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { }); |
| 182 |
template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler); |
|
|
| 183 |
template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { }); |
182 |
template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { }); |
| 184 |
template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { }); |
183 |
template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { }); |
| 185 |
|
184 |
|
| 186 |
bool sendMessage(std::unique_ptr<Encoder>, OptionSet<SendOption> sendOptions); |
185 |
bool sendMessage(std::unique_ptr<Encoder>, OptionSet<SendOption> sendOptions); |
| 187 |
void sendMessageWithReply(uint64_t requestID, std::unique_ptr<Encoder>, FunctionDispatcher& replyDispatcher, Function<void(std::unique_ptr<Decoder>)>&& replyHandler); |
|
|
| 188 |
std::unique_ptr<Encoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID); |
186 |
std::unique_ptr<Encoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID); |
| 189 |
std::unique_ptr<Decoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder>, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions); |
187 |
std::unique_ptr<Decoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder>, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions); |
| 190 |
bool sendSyncReply(std::unique_ptr<Encoder>); |
188 |
bool sendSyncReply(std::unique_ptr<Encoder>); |
|
Lines 434-461
void Connection::sendWithAsyncReply(T&&
Source/WebKit/Platform/IPC/Connection.h_sec2
|
| 434 |
}); |
432 |
}); |
| 435 |
} |
433 |
} |
| 436 |
|
434 |
|
| 437 |
template<typename T> |
|
|
| 438 |
void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler) |
| 439 |
{ |
| 440 |
uint64_t requestID = 0; |
| 441 |
std::unique_ptr<Encoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, requestID); |
| 442 |
|
| 443 |
encoder->encode(message.arguments()); |
| 444 |
|
| 445 |
sendMessageWithReply(requestID, WTFMove(encoder), replyDispatcher, [replyHandler = WTFMove(replyHandler)](std::unique_ptr<Decoder> decoder) { |
| 446 |
if (decoder) { |
| 447 |
Optional<typename CodingType<typename T::Reply>::Type> reply; |
| 448 |
*decoder >> reply; |
| 449 |
if (reply) { |
| 450 |
replyHandler(WTFMove(*reply)); |
| 451 |
return; |
| 452 |
} |
| 453 |
} |
| 454 |
|
| 455 |
replyHandler(WTF::nullopt); |
| 456 |
}); |
| 457 |
} |
| 458 |
|
| 459 |
template<size_t i, typename A, typename B> struct TupleMover { |
435 |
template<size_t i, typename A, typename B> struct TupleMover { |
| 460 |
static void move(A&& a, B& b) |
436 |
static void move(A&& a, B& b) |
| 461 |
{ |
437 |
{ |