diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 05:00:03 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 05:00:03 +0000 |
commit | 267b87c0aa32347450700654e54a5ce620ad2112 (patch) | |
tree | 4751ec7b865667693dbf74a4431a406671a67ffb /webkit | |
parent | 77cc2e27ca0da9a74c21767371ef83c20f640acb (diff) | |
download | chromium_src-267b87c0aa32347450700654e54a5ce620ad2112.zip chromium_src-267b87c0aa32347450700654e54a5ce620ad2112.tar.gz chromium_src-267b87c0aa32347450700654e54a5ce620ad2112.tar.bz2 |
Page cycler tests failed on Vista because our windowless plugin code fails to write the original flash windowless proc
in the window handle as a property via SetProp. Some debugging revealed that SetProp internally calls GlobalAddAtom which
fails at times with STATUS_NO_MEMORY. It appears that the flash plugin process runs out win32 heap quota at times.
To work around this we save away the original proc in a map.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=48478
Bug=48478
Review URL: http://codereview.chromium.org/2897002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_win.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc index d822b2e..87bb088 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc @@ -4,6 +4,7 @@ #include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include <map> #include <string> #include <vector> @@ -37,7 +38,6 @@ namespace { 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,6 +62,9 @@ WebPluginDelegateImpl* g_current_plugin_instance = NULL; 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( @@ -644,12 +647,16 @@ void WebPluginDelegateImpl::ThrottleMessage(WNDPROC proc, HWND hwnd, // 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 @@ BOOL CALLBACK EnumFlashWindows(HWND window, LPARAM arg) { 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; |