diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 18:47:13 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 18:47:13 +0000 |
commit | e9700908ca95dcac6d48f0a695bd17494053a69a (patch) | |
tree | ec25189e1bb5f89956a74e3d879dcbec536e0006 | |
parent | c05c7c9b8791fbf4731995ecc8dc48ca4a7347b0 (diff) | |
download | chromium_src-e9700908ca95dcac6d48f0a695bd17494053a69a.zip chromium_src-e9700908ca95dcac6d48f0a695bd17494053a69a.tar.gz chromium_src-e9700908ca95dcac6d48f0a695bd17494053a69a.tar.bz2 |
Only unset the kWebPluginDelegateProperty property after calling the plugin's windowproc, otherwise if it ends up dispatching another message to itself we'll hit the NOTREACHED at the beginning of the function.
Review URL: http://codereview.chromium.org/99267
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15077 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.cc | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index 7a48c48..2addf7f 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -855,31 +855,15 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( g_current_plugin_instance = delegate; - switch (message) { - case WM_NCDESTROY: { - RemoveProp(hwnd, kWebPluginDelegateProperty); - ATOM plugin_name_atom = reinterpret_cast <ATOM>( - RemoveProp(hwnd, kPluginNameAtomProperty)); - if (plugin_name_atom != 0) - GlobalDeleteAtom(plugin_name_atom); - ClearThrottleQueueForWindow(hwnd); - break; - } - // Flash may flood the message queue with WM_USER+1 message causing 100% CPU - // usage. See https://bugzilla.mozilla.org/show_bug.cgi?id=132759. We - // prevent this by throttling the messages. - case WM_USER + 1: { - if (delegate->GetQuirks() & PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE) { - WebPluginDelegateImpl::ThrottleMessage(delegate->plugin_wnd_proc_, hwnd, - message, wparam, lparam); - g_current_plugin_instance = last_plugin_instance; - return FALSE; - } - break; - } - default: { - break; - } + // Flash may flood the message queue with WM_USER+1 message causing 100% CPU + // usage. See https://bugzilla.mozilla.org/show_bug.cgi?id=132759. We + // prevent this by throttling the messages. + if (message == WM_USER + 1 && + delegate->GetQuirks() & PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE) { + WebPluginDelegateImpl::ThrottleMessage(delegate->plugin_wnd_proc_, hwnd, + message, wparam, lparam); + g_current_plugin_instance = last_plugin_instance; + return FALSE; } delegate->last_message_ = message; @@ -901,6 +885,16 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( wparam, lparam); delegate->is_calling_wndproc = false; g_current_plugin_instance = last_plugin_instance; + + if (message == WM_NCDESTROY) { + RemoveProp(hwnd, kWebPluginDelegateProperty); + ATOM plugin_name_atom = reinterpret_cast <ATOM>( + RemoveProp(hwnd, kPluginNameAtomProperty)); + if (plugin_name_atom != 0) + GlobalDeleteAtom(plugin_name_atom); + ClearThrottleQueueForWindow(hwnd); + } + return result; } |