From 8402216f491cfbc56d41b47a871b2609a6e47ffe Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 25 Jun 2010 20:35:20 +0000 Subject: GTK: add more syncronization to GtkNativeViewIdManager to avoid a crash. BUG=46197 TEST=manual (see bug) Review URL: http://codereview.chromium.org/2860024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50886 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/resource_message_filter_gtk.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc index 56b53fe..97e1c14 100644 --- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc +++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc @@ -70,6 +70,7 @@ void ResourceMessageFilter::DoOnGetWindowRect(gfx::NativeViewId view, gfx::Rect rect; XID window; + AutoLock lock(Singleton()->unrealize_lock()); if (Singleton()->GetXIDForId(&window, view)) { if (window) { int x, y; @@ -109,13 +110,16 @@ void ResourceMessageFilter::DoOnGetRootWindowRect(gfx::NativeViewId view, gfx::Rect rect; XID window; + AutoLock lock(Singleton()->unrealize_lock()); if (Singleton()->GetXIDForId(&window, view)) { if (window) { const XID toplevel = GetTopLevelWindow(window); - int x, y; - unsigned width, height; - if (x11_util::GetWindowGeometry(&x, &y, &width, &height, toplevel)) - rect = gfx::Rect(x, y, width, height); + if (toplevel) { + int x, y; + unsigned width, height; + if (x11_util::GetWindowGeometry(&x, &y, &width, &height, toplevel)) + rect = gfx::Rect(x, y, width, height); + } } } -- cgit v1.1