summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 02:15:08 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 02:15:08 +0000
commit0be241219a6cecb753ae4fdfb049f75530353771 (patch)
tree74eef3fce4d24a8ab40724d1d5243482d07dfdbd /content
parent244f2b3b9ff0cc85d5c94f33006c417fc8f3220e (diff)
downloadchromium_src-0be241219a6cecb753ae4fdfb049f75530353771.zip
chromium_src-0be241219a6cecb753ae4fdfb049f75530353771.tar.gz
chromium_src-0be241219a6cecb753ae4fdfb049f75530353771.tar.bz2
Don't send ViewMsg_ContextMenuClosed to the renderer process for submenus.
Note: currently SimpleMenuModel::Delegate doesn't receive the same notifications on all platforms. On Windows and CrOS, MenuWillShow and MenuClosed are sent for all menus (including submenus); while these notifications are not sent for submenus on Linux (haven't tested Mac). This CL makes sure that on Windows and CrOS no ViewMsg_ContextMenuClosed messages are generated for submenus, but it doesn't unify the behavior of SimpleMenuModel::Delegate. I have filed a bug (http://code.google.com/p/chromium/issues/detail?id=90732) to track that issue. BUG=None TEST= - make sure you are running Pepper Flash on either CrOS or Windows; - go to www.hulu.com; - open context menu on the flash content; - move the cursor onto the Quality item to open a submenu; - move the cursor away; - the renderer process shouldn't crash. Review URL: http://codereview.chromium.org/7492054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 325f3f8..6ba3f63 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -1226,12 +1226,14 @@ int32_t PepperPluginDelegateImpl::ShowContextMenu(
void PepperPluginDelegateImpl::OnContextMenuClosed(
const webkit_glue::CustomContextMenuContext& custom_context) {
int request_id = custom_context.request_id;
- scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl> menu =
- *pending_context_menus_.Lookup(request_id);
- if (!menu) {
+ scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>* menu_ptr =
+ pending_context_menus_.Lookup(request_id);
+ if (!menu_ptr) {
NOTREACHED() << "CompleteShowContextMenu() called twice for the same menu.";
return;
}
+ scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl> menu = *menu_ptr;
+ DCHECK(menu.get());
pending_context_menus_.Remove(request_id);
if (has_saved_context_menu_action_) {