Stop receiving IPC messages on frozen RenderWidgets.
There are two exceptions: device emulation and visual properties messages both
need to be processed on frozen render widgets for Chrome to functional properly.
This will need to be fixed.
Bug: 1000502
Change-Id: I7155199513ca45ed65d076551c448946272e85e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1784132
Commit-Queue: Erik Chen <[email protected]>
Auto-Submit: Erik Chen <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#693552}
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index e96b1141..be2a3f0 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -613,6 +613,23 @@
}
bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
+ bool handled = false;
+ IPC_BEGIN_MESSAGE_MAP(RenderWidget, message)
+ IPC_MESSAGE_HANDLER(WidgetMsg_SynchronizeVisualProperties,
+ OnSynchronizeVisualProperties)
+ IPC_MESSAGE_HANDLER(WidgetMsg_EnableDeviceEmulation,
+ OnEnableDeviceEmulation)
+ IPC_MESSAGE_HANDLER(WidgetMsg_DisableDeviceEmulation,
+ OnDisableDeviceEmulation)
+ IPC_END_MESSAGE_MAP()
+ if (handled)
+ return true;
+
+ // TODO(https://crbug.com/1000502): Don't process IPC messages on frozen
+ // RenderWidgets. We would like to eventually remove them altogether, so they
+ // won't be able to process IPC messages.
+ if (is_frozen())
+ return false;
#if defined(OS_MACOSX)
if (IPC_MESSAGE_CLASS(message) == TextInputClientMsgStart)
return text_input_client_observer_->OnMessageReceived(message);
@@ -621,16 +638,9 @@
mouse_lock_dispatcher_->OnMessageReceived(message))
return true;
- bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderWidget, message)
IPC_MESSAGE_HANDLER(WidgetMsg_ShowContextMenu, OnShowContextMenu)
IPC_MESSAGE_HANDLER(WidgetMsg_Close, OnClose)
- IPC_MESSAGE_HANDLER(WidgetMsg_SynchronizeVisualProperties,
- OnSynchronizeVisualProperties)
- IPC_MESSAGE_HANDLER(WidgetMsg_EnableDeviceEmulation,
- OnEnableDeviceEmulation)
- IPC_MESSAGE_HANDLER(WidgetMsg_DisableDeviceEmulation,
- OnDisableDeviceEmulation)
IPC_MESSAGE_HANDLER(WidgetMsg_WasHidden, OnWasHidden)
IPC_MESSAGE_HANDLER(WidgetMsg_WasShown, OnWasShown)
IPC_MESSAGE_HANDLER(WidgetMsg_SetActive, OnSetActive)