diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:28:06 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:28:06 +0000 |
commit | ea93d382adb65db32f6d88aa32315b84efe18667 (patch) | |
tree | df20a55a2086e86cf3bad08e5fbc3862cbd154b3 /chrome | |
parent | b0014d562ea08a6deb2584c6ba70c9458659204c (diff) | |
download | chromium_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.cc | 5 |
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 = |