summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 20:35:20 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 20:35:20 +0000
commit8402216f491cfbc56d41b47a871b2609a6e47ffe (patch)
tree0f64ce92e8b149b00d97a34f9fefd0b6c6f8f6fd /chrome
parent4c46659fc913b8507f2c4df8eab96b1bda248199 (diff)
downloadchromium_src-8402216f491cfbc56d41b47a871b2609a6e47ffe.zip
chromium_src-8402216f491cfbc56d41b47a871b2609a6e47ffe.tar.gz
chromium_src-8402216f491cfbc56d41b47a871b2609a6e47ffe.tar.bz2
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
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_gtk.cc12
1 files changed, 8 insertions, 4 deletions
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<GtkNativeViewManager>()->unrealize_lock());
if (Singleton<GtkNativeViewManager>()->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<GtkNativeViewManager>()->unrealize_lock());
if (Singleton<GtkNativeViewManager>()->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);
+ }
}
}