|
Lines 260-266
Connection::Connection(Identifier identifier, bool isServer, Client& client)
a/Source/WebKit/Platform/IPC/Connection.cpp_sec1
|
| 260 |
, m_inDispatchMessageCount(0) |
260 |
, m_inDispatchMessageCount(0) |
| 261 |
, m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount(0) |
261 |
, m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount(0) |
| 262 |
, m_didReceiveInvalidMessage(false) |
262 |
, m_didReceiveInvalidMessage(false) |
| 263 |
, m_waitingForMessage(nullptr) |
|
|
| 264 |
, m_shouldWaitForSyncReplies(true) |
263 |
, m_shouldWaitForSyncReplies(true) |
| 265 |
{ |
264 |
{ |
| 266 |
ASSERT(RunLoop::isMain()); |
265 |
ASSERT(RunLoop::isMain()); |
|
Lines 468-473
Seconds Connection::timeoutRespectingIgnoreTimeoutsForTesting(Seconds timeout) c
a/Source/WebKit/Platform/IPC/Connection.cpp_sec2
|
| 468 |
std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions) |
467 |
std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions) |
| 469 |
{ |
468 |
{ |
| 470 |
ASSERT(RunLoop::isMain()); |
469 |
ASSERT(RunLoop::isMain()); |
|
|
470 |
auto protectedThis = makeRef(*this); |
| 471 |
|
471 |
|
| 472 |
timeout = timeoutRespectingIgnoreTimeoutsForTesting(timeout); |
472 |
timeout = timeoutRespectingIgnoreTimeoutsForTesting(timeout); |
| 473 |
|
473 |
|
|
Lines 494-500
std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageRecei
a/Source/WebKit/Platform/IPC/Connection.cpp_sec3
|
| 494 |
|
494 |
|
| 495 |
// Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue. |
495 |
// Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue. |
| 496 |
if (hasIncomingSynchronousMessage && waitForOptions.contains(WaitForOption::InterruptWaitingIfSyncMessageArrives)) { |
496 |
if (hasIncomingSynchronousMessage && waitForOptions.contains(WaitForOption::InterruptWaitingIfSyncMessageArrives)) { |
| 497 |
m_waitingForMessage = nullptr; |
497 |
#if !ASSERT_DISABLED |
|
|
498 |
std::lock_guard<Lock> lock(m_waitForMessageMutex); |
| 499 |
// We don't support having multiple clients waiting for messages. |
| 500 |
ASSERT(!m_waitingForMessage); |
| 501 |
#endif |
| 498 |
return nullptr; |
502 |
return nullptr; |
| 499 |
} |
503 |
} |
| 500 |
|
504 |
|
|
Lines 505-510
std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageRecei
a/Source/WebKit/Platform/IPC/Connection.cpp_sec4
|
| 505 |
|
509 |
|
| 506 |
// We don't support having multiple clients waiting for messages. |
510 |
// We don't support having multiple clients waiting for messages. |
| 507 |
ASSERT(!m_waitingForMessage); |
511 |
ASSERT(!m_waitingForMessage); |
|
|
512 |
if (m_waitingForMessage) |
| 513 |
return nullptr; |
| 508 |
|
514 |
|
| 509 |
m_waitingForMessage = &waitingForMessage; |
515 |
m_waitingForMessage = &waitingForMessage; |
| 510 |
} |
516 |
} |