diff --git a/browser/base/content/test/trackingUI/browser.ini b/browser/base/content/test/trackingUI/browser.ini index 252896d3e3bd..5adc7159a79f 100644 --- a/browser/base/content/test/trackingUI/browser.ini +++ b/browser/base/content/test/trackingUI/browser.ini @@ -29,7 +29,7 @@ support-files = [browser_trackingUI_open_preferences.js] [browser_trackingUI_pbmode_exceptions.js] [browser_trackingUI_report_breakage.js] -skip-if = fission || os == 'linux' && (debug || asan) # Bug 1546797 +skip-if = skip-if = fission || debug || asan # Bug 1546797 [browser_trackingUI_state.js] skip-if = serviceworker_e10s # see https://bugzilla.mozilla.org/show_bug.cgi?id=1511303#c1 [browser_trackingUI_state_reset.js] diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index 0cb6e422920b..e596172b60a8 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -556,6 +556,18 @@ static void TryRegisterStrongMemoryReporter() { Atomic MessageChannel::gUnresolvedResponses; +// Channels in record/replay middleman processes can forward messages that +// originated in a child recording process. Middleman processes are given +// a large negative sequence number so that sequence numbers on their messages +// can be distinguished from those on recording process messages. +static const int32_t MiddlemanStartSeqno = -(1 << 30); + +/* static */ +bool MessageChannel::MessageOriginatesFromMiddleman(const Message& aMessage) { + MOZ_ASSERT(recordreplay::IsMiddleman()); + return aMessage.seqno() < MiddlemanStartSeqno; +} + MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener) : mName(aName), mListener(aListener), @@ -605,6 +617,10 @@ MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener) TryRegisterStrongMemoryReporter(); TryRegisterStrongMemoryReporter(); + + if (recordreplay::IsMiddleman()) { + mNextSeqno = MiddlemanStartSeqno; + } } MessageChannel::~MessageChannel() { diff --git a/ipc/glue/MessageChannel.h b/ipc/glue/MessageChannel.h index 87e3810b7ce7..e3e7a5c4f48b 100644 --- a/ipc/glue/MessageChannel.h +++ b/ipc/glue/MessageChannel.h @@ -318,6 +318,10 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver { */ bool IsCrossProcess() const { return mIsCrossProcess; } + // Return whether a message definitely originated from a middleman process, + // due to its sequence number. + static bool MessageOriginatesFromMiddleman(const Message& aMessage); + #ifdef OS_WIN struct MOZ_STACK_CLASS SyncStackFrame { SyncStackFrame(MessageChannel* channel, bool interrupt); diff --git a/toolkit/recordreplay/ipc/ParentForwarding.cpp b/toolkit/recordreplay/ipc/ParentForwarding.cpp index d3bf3bfae09a..5c78f3b9623c 100644 --- a/toolkit/recordreplay/ipc/ParentForwarding.cpp +++ b/toolkit/recordreplay/ipc/ParentForwarding.cpp @@ -140,6 +140,12 @@ static bool HandleMessageInMiddleman(ipc::Side aSide, return false; } + // Asynchronous replies to messages originally sent by the middleman need to + // be handled in the middleman. + if (ipc::MessageChannel::MessageOriginatesFromMiddleman(aMessage)) { + return true; + } + return false; }