Commit bcb4584a authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Don't process device emulation IPC messages on undead RenderWidgets.

We still process the IPC messages on provisional RenderWidgets, but this CL
confirms that we don't need to receive any IPC messages on undead RenderWidgets.

Bug: 912193
Change-Id: I79b6dd77bfeebb60d367dc8977cbb62854a60519
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1804686
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696880}
parent f045f6dc
......@@ -624,6 +624,14 @@ void RenderWidget::OnShowHostContextMenu(ContextMenuParams* params) {
}
bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
// TODO(https://crbug.com/1000502): Don't process IPC messages on undead
// RenderWidgets. We would like to eventually remove them altogether, so they
// won't be able to process IPC messages. An undead widget may become
// provisional again, so we must check for that too. Provisional frames don't
// receive messages until swapped in.
if (is_undead_)
return false;
bool handled = false;
IPC_BEGIN_MESSAGE_MAP(RenderWidget, message)
IPC_MESSAGE_HANDLER(WidgetMsg_EnableDeviceEmulation,
......@@ -634,13 +642,11 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
if (handled)
return true;
// TODO(https://crbug.com/1000502): Don't process IPC messages on undead
// RenderWidgets. We would like to eventually remove them altogether, so they
// won't be able to process IPC messages. An undead widget may become
// provisional again, so we must check for that too. Provisional frames don't
// receive messages until swapped in.
if (IsUndeadOrProvisional())
// TODO(https://crbug.com/1000502): We shouldn't process IPC messages on
// provisional frames.
if (IsForProvisionalFrame())
return false;
#if defined(OS_MACOSX)
if (IPC_MESSAGE_CLASS(message) == TextInputClientMsgStart)
return text_input_client_observer_->OnMessageReceived(message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment