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

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

Issue 2897002: Page cycler tests failed on Vista because our windowless plugin code fails to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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_win.cc
===================================================================
--- webkit/glue/plugins/webplugin_delegate_impl_win.cc (revision 51716)
+++ webkit/glue/plugins/webplugin_delegate_impl_win.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/glue/plugins/webplugin_delegate_impl.h"
+#include <map>
#include <string>
#include <vector>
@@ -37,7 +38,6 @@
const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty";
const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom";
const wchar_t kDummyActivationWindowName[] = L"DummyWindowForActivation";
-const wchar_t kPluginOrigProc[] = L"OriginalPtr";
const wchar_t kPluginFlashThrottle[] = L"FlashThrottle";
// The fastest we are willing to process WM_USER+1 events for Flash.
@@ -62,7 +62,10 @@
typedef std::deque<MSG> ThrottleQueue;
base::LazyInstance<ThrottleQueue> g_throttle_queue(base::LINKER_INITIALIZED);
+base::LazyInstance<std::map<HWND, WNDPROC> > g_window_handle_proc_map(
+ base::LINKER_INITIALIZED);
+
// Helper object for patching the TrackPopupMenu API.
base::LazyInstance<iat_patch::IATPatchFunction> g_iat_patch_track_popup_menu(
base::LINKER_INITIALIZED);
@@ -644,12 +647,16 @@
// static
LRESULT CALLBACK WebPluginDelegateImpl::FlashWindowlessWndProc(HWND hwnd,
UINT message, WPARAM wparam, LPARAM lparam) {
- WNDPROC old_proc = reinterpret_cast<WNDPROC>(GetProp(hwnd, kPluginOrigProc));
+ std::map<HWND, WNDPROC>::iterator index =
+ g_window_handle_proc_map.Get().find(hwnd);
+
+ WNDPROC old_proc = (*index).second;
DCHECK(old_proc);
switch (message) {
case WM_NCDESTROY: {
WebPluginDelegateImpl::ClearThrottleQueueForWindow(hwnd);
+ g_window_handle_proc_map.Get().erase(index);
break;
}
// Flash may flood the message queue with WM_USER+1 message causing 100% CPU
@@ -687,11 +694,7 @@
window, GWLP_WNDPROC,
reinterpret_cast<LONG>(wnd_proc)));
DCHECK(old_flash_proc);
- BOOL result = SetProp(window, kPluginOrigProc, old_flash_proc);
- if (!result) {
- LOG(ERROR) << "SetProp failed, last error = " << GetLastError();
- return FALSE;
- }
+ g_window_handle_proc_map.Get()[window] = old_flash_proc;
}
return TRUE;
« 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