Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1129)

Unified Diff: webkit/glue/plugins/webplugin_delegate_impl.cc

Issue 99267: Only unset the kWebPluginDelegateProperty property after calling the plugin's... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/webplugin_delegate_impl.cc
===================================================================
--- webkit/glue/plugins/webplugin_delegate_impl.cc (revision 15004)
+++ webkit/glue/plugins/webplugin_delegate_impl.cc (working copy)
@@ -855,31 +855,15 @@
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 @@
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698