summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/native_menu_gtk.h
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:24:26 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:24:26 +0000
commit22dad3878fa8a21e1e03d46f0c0ec19983d9c5e6 (patch)
tree13d50311c04389649c95b3a8285e4df3a537a30b /views/controls/menu/native_menu_gtk.h
parent00ed48fe2d42c952a3d41c83ed26a130342521aa (diff)
downloadchromium_src-22dad3878fa8a21e1e03d46f0c0ec19983d9c5e6.zip
chromium_src-22dad3878fa8a21e1e03d46f0c0ec19983d9c5e6.tar.gz
chromium_src-22dad3878fa8a21e1e03d46f0c0ec19983d9c5e6.tar.bz2
Menu crash fix for domui/gtk menu that is caused by multiple context menu requests.
Renderer may issue multiple ContextMenu request even if the menu is open.(this happenes when renderer receives mouse events before context menu is actually opened by previous request.) This is causing a crash in menu2 (both domiu/gtk impl) because menu2 has nested message loop, and the menu object gets deleted by 2nd request while it's handling message loop. This CL addresses this issue by creating separate object to handle the nested loop. Use only variables on stack and do not touch instance variable if the menu is already deleted. BUG=chromium-os:7929, chromium-os:7228 TEST=manual. on a page, continously click mouse to open/close context menu. It used to crash at some point, but shouldn't crash with this patch. Review URL: http://codereview.chromium.org/4046004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/native_menu_gtk.h')
-rw-r--r--views/controls/menu/native_menu_gtk.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h
index 79a6060..6145925 100644
--- a/views/controls/menu/native_menu_gtk.h
+++ b/views/controls/menu/native_menu_gtk.h
@@ -21,6 +21,8 @@ class MenuModel;
namespace views {
+class NestedDispatcherGtk;
+
// A Gtk implementation of MenuWrapper.
//
// NOTE: On windows the activate message is not sent immediately when an item
@@ -136,6 +138,11 @@ class NativeMenuGtk : public MenuWrapper,
// Vector of listeners to receive callbacks when the menu opens.
std::vector<MenuListener*> listeners_;
+ // Nested dispatcher object that can outlive this object.
+ // This is to deal with the menu being deleted while the nested
+ // message loop is handled. see http://crosbug.com/7228 .
+ NestedDispatcherGtk* nested_dispatcher_;
+
DISALLOW_COPY_AND_ASSIGN(NativeMenuGtk);
};