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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 24012: Validate HWNDs that the renderer asks to be moved. (Closed)
Patch Set: Created 11 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/gfx/gdi_util.h" 8 #include "base/gfx/gdi_util.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 for (size_t i = 0; i < plugin_window_moves.size(); ++i) { 158 for (size_t i = 0; i < plugin_window_moves.size(); ++i) {
159 unsigned long flags = 0; 159 unsigned long flags = 0;
160 const WebPluginGeometry& move = plugin_window_moves[i]; 160 const WebPluginGeometry& move = plugin_window_moves[i];
161 161
162 // As the plugin parent window which lives on the browser UI thread is 162 // As the plugin parent window which lives on the browser UI thread is
163 // destroyed asynchronously, it is possible that we have a stale window 163 // destroyed asynchronously, it is possible that we have a stale window
164 // sent in by the renderer for moving around. 164 // sent in by the renderer for moving around.
165 if (!::IsWindow(move.window)) 165 if (!::IsWindow(move.window))
166 continue; 166 continue;
167 167
168 // The renderer should only be trying to move windows that are children
169 // of its render widget window.
170 if (::IsChild(m_hWnd, move.window) == 0) {
jam 2009/02/12 19:27:26 If we're doing this check, we don't need the IsWin
171 NOTREACHED();
172 continue;
173 }
174
168 if (move.visible) 175 if (move.visible)
169 flags |= SWP_SHOWWINDOW; 176 flags |= SWP_SHOWWINDOW;
170 else 177 else
171 flags |= SWP_HIDEWINDOW; 178 flags |= SWP_HIDEWINDOW;
172 179
173 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), 180 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(),
174 move.clip_rect.y(), 181 move.clip_rect.y(),
175 move.clip_rect.right(), 182 move.clip_rect.right(),
176 move.clip_rect.bottom()); 183 move.clip_rect.bottom());
177 gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); 184 gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects);
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 // WM_LBUTTONDOWN. 979 // WM_LBUTTONDOWN.
973 SetFocus(); 980 SetFocus();
974 } 981 }
975 } 982 }
976 983
977 void RenderWidgetHostViewWin::ShutdownHost() { 984 void RenderWidgetHostViewWin::ShutdownHost() {
978 shutdown_factory_.RevokeAll(); 985 shutdown_factory_.RevokeAll();
979 render_widget_host_->Shutdown(); 986 render_widget_host_->Shutdown();
980 // Do not touch any members at this point, |this| has been deleted. 987 // Do not touch any members at this point, |this| has been deleted.
981 } 988 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698