Bug 1499828 Part 4 - Handle input events in the middleman when the active child is replaying, r=mccr8.
--- a/toolkit/recordreplay/ipc/ParentForwarding.cpp
+++ b/toolkit/recordreplay/ipc/ParentForwarding.cpp
@@ -87,16 +87,24 @@ HandleMessageInMiddleman(ipc::Side aSide
type == dom::PContent::Msg_SaveRecording__ID ||
// Teardown that should only happen in the middleman.
type == dom::PContent::Msg_Shutdown__ID) {
ipc::IProtocol::Result r = dom::ContentChild::GetSingleton()->PContentChild::OnMessageReceived(aMessage);
MOZ_RELEASE_ASSERT(r == ipc::IProtocol::MsgProcessed);
return true;
}
+ // Send input events to the middleman when the active child is replaying,
+ // so that UI elements such as the replay overlay can be interacted with.
+ if (!ActiveChildIsRecording() && nsContentUtils::IsMessageInputEvent(aMessage)) {
+ ipc::IProtocol::Result r = dom::ContentChild::GetSingleton()->PContentChild::OnMessageReceived(aMessage);
+ MOZ_RELEASE_ASSERT(r == ipc::IProtocol::MsgProcessed);
+ return true;
+ }
+
// The content process has its own compositor, so compositor messages from
// the UI process should only be handled in the middleman.
if (type >= layers::PCompositorBridge::PCompositorBridgeStart &&
type <= layers::PCompositorBridge::PCompositorBridgeEnd) {
layers::CompositorBridgeChild* compositorChild = layers::CompositorBridgeChild::Get();
ipc::IProtocol::Result r = compositorChild->OnMessageReceived(aMessage);
MOZ_RELEASE_ASSERT(r == ipc::IProtocol::MsgProcessed);
return true;
--- a/toolkit/recordreplay/ipc/ParentIPC.cpp
+++ b/toolkit/recordreplay/ipc/ParentIPC.cpp
@@ -278,17 +278,17 @@ public:
MOZ_CRASH("Unexpected message");
}
}
};
bool
ActiveChildIsRecording()
{
- return gActiveChild->IsRecording();
+ return gActiveChild && gActiveChild->IsRecording();
}
ChildProcessInfo*
ActiveRecordingChild()
{
MOZ_RELEASE_ASSERT(ActiveChildIsRecording());
return gActiveChild;
}