Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: content/renderer/render_view_impl.cc

Issue 1408873002: Ignore InputMsg IPCs if RenderView is in swapped out state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index c768e6ae073f519df9c20937a201516d44242b10..92f795f7514233213b290648f3d3d90dee1c48d5 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1276,6 +1276,11 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
if (main_frame && main_frame->isWebLocalFrame())
GetContentClient()->SetActiveURL(main_frame->document().url());
+ // Input IPC messages must not be processed if the RenderView is in
+ // swapped out state.
+ if (IPC_MESSAGE_ID_CLASS(message.type()) == InputMsgStart)
alexmos 2015/10/15 22:52:38 Shouldn't there be an actual check here that the v
nasko 2015/10/15 23:18:26 d'oh!
+ return false;
+
base::ObserverListBase<RenderViewObserver>::Iterator it(&observers_);
RenderViewObserver* observer;
while ((observer = it.GetNext()) != NULL)
@@ -3066,6 +3071,9 @@ GURL RenderViewImpl::GetURLForGraphicsContext3D() {
}
void RenderViewImpl::OnSetFocus(bool enable) {
+ // RenderView getting focus must always have a WebLocalFrame as the main
+ // frame.
+ CHECK(!enable || webview()->mainFrame()->isWebLocalFrame());
alexmos 2015/10/15 22:52:38 I wonder if "!enable" is needed. If there's no cu
nasko 2015/10/15 23:18:26 Done.
RenderWidget::OnSetFocus(enable);
#if defined(ENABLE_PLUGINS)

Powered by Google App Engine
This is Rietveld 408576698