Bug 1483248 Part 2 - Always forward destroy messages to recording TabChild, r=mccr8.

--HG--
extra : rebase_source : d98c5967adcc0288ec12ce60c81f8fe24a0cbe42
This commit is contained in:
Brian Hackett 2018-08-21 00:59:18 +00:00
parent 3570b01c28
commit 7f6faaf16f

View file

@ -110,6 +110,18 @@ HandleMessageInMiddleman(ipc::Side aSide, const IPC::Message& aMessage)
return false;
}
// Return whether a message should be sent to the recording child, even if it
// is not currently active.
static bool
AlwaysForwardMessage(const IPC::Message& aMessage)
{
IPC::Message::msgid_t type = aMessage.type();
// Forward close messages so that the tab shuts down properly even if it is
// currently replaying.
return type == dom::PBrowser::Msg_Destroy__ID;
}
static bool gMainThreadIsWaitingForIPDLReply = false;
bool
@ -154,7 +166,7 @@ public:
}
static void ForwardMessageAsync(MiddlemanProtocol* aProtocol, Message* aMessage) {
if (ActiveChildIsRecording()) {
if (ActiveChildIsRecording() || AlwaysForwardMessage(*aMessage)) {
PrintSpew("ForwardAsyncMsg %s %s %d\n",
(aProtocol->mSide == ipc::ChildSide) ? "Child" : "Parent",
IPC::StringFromIPCMessageType(aMessage->type()),