Merge inbound to mozilla-central. a=merge

This commit is contained in:
Mihai Alexandru Michis 2019-07-18 18:40:17 +03:00
Родитель 6975564f1a 73076a77d0
Коммит 6680f22a86
4 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -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]

Просмотреть файл

@ -556,6 +556,18 @@ static void TryRegisterStrongMemoryReporter() {
Atomic<size_t> 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<PendingResponseReporter>();
TryRegisterStrongMemoryReporter<ChannelCountReporter>();
if (recordreplay::IsMiddleman()) {
mNextSeqno = MiddlemanStartSeqno;
}
}
MessageChannel::~MessageChannel() {

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;
}