summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 23:28:06 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 23:28:06 +0000
commitea93d382adb65db32f6d88aa32315b84efe18667 (patch)
treedf20a55a2086e86cf3bad08e5fbc3862cbd154b3 /chrome
parentb0014d562ea08a6deb2584c6ba70c9458659204c (diff)
downloadchromium_src-ea93d382adb65db32f6d88aa32315b84efe18667.zip
chromium_src-ea93d382adb65db32f6d88aa32315b84efe18667.tar.gz
chromium_src-ea93d382adb65db32f6d88aa32315b84efe18667.tar.bz2
Linux: fix crash when renderer asks for the location of a NULL window
There are cases where the renderer asks for the root rectangle of its window before we have a window for it. Since we still have the NativeViewId hack in place, this previously caused a crash. Review URL: http://codereview.chromium.org/42356 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_gtk.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
index 6b5d585..12d1905 100644
--- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
@@ -21,6 +21,11 @@ void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id,
void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id,
gfx::Rect* rect) {
+ if (!window_id) {
+ *rect = gfx::Rect();
+ return;
+ }
+
// Windows uses GetAncestor(window, GA_ROOT) here which probably means
// we want the top level window.
GdkWindow* window =