summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 23:32:02 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 23:32:02 +0000
commit4696243c596cc669c58818ee73234d46cb855eb4 (patch)
tree17335ec7e52b243c956fe605fe0872355927cc4b /chrome/browser/renderer_host
parent886e1e3fb41358c4d8ea0577095309cb678d1ed9 (diff)
downloadchromium_src-4696243c596cc669c58818ee73234d46cb855eb4.zip
chromium_src-4696243c596cc669c58818ee73234d46cb855eb4.tar.gz
chromium_src-4696243c596cc669c58818ee73234d46cb855eb4.tar.bz2
Ignore invalid plugin windows coming in from the renderer for moving. As the plugin parent window which lives on the browser UI thread is destroyed asynchronously, we may have stale windows which have already been destroyed sent by the renderer for moving around.The DeferWindowPos API fails on receiving such a window.
Review URL: http://codereview.chromium.org/19523 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8994 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 4459d26..2c19e7e 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -158,6 +158,12 @@ void RenderWidgetHostViewWin::MovePluginWindows(
unsigned long flags = 0;
const WebPluginGeometry& move = plugin_window_moves[i];
+ // As the plugin parent window which lives on the browser UI thread is
+ // destroyed asynchronously, it is possible that we have a stale window
+ // sent in by the renderer for moving around.
+ if (!::IsWindow(move.window))
+ continue;
+
if (move.visible)
flags |= SWP_SHOWWINDOW;
else
@@ -180,7 +186,7 @@ void RenderWidgetHostViewWin::MovePluginWindows(
move.window_rect.width(),
move.window_rect.height(), flags);
if (!defer_window_pos_info) {
- DCHECK(false) << "DeferWindowPos given invalid window, so rest ignored.";
+ DCHECK(false) << "DeferWindowPos failed, so all plugin moves ignored.";
return;
}
}