Bug 676361 Plugin hangs when content's script accesses plugin at mouse wheel event which wasn't consumed by the plugin r=jimm
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 09 Aug 2011 10:12:03 +0900
changeset 74067 87e3ea12ed5d1dbf2dedc6c9a73ab25fac29ee47
parent 74066 a690d8fbcc48a4602a75caf1330ad635de3ecb2b
child 74068 cee834f57d427629d61c8bf0d975a368e945309c
child 74091 08327218cb8bd31bd4b91993a63bde497a5f7842
push id1072
push userCallek@gmail.com
push dateTue, 09 Aug 2011 10:30:47 +0000
treeherdermozilla-inbound@cee834f57d42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs676361
milestone8.0a1
first release with
nightly linux32
87e3ea12ed5d / 8.0a1 / 20110809030751 / files
nightly linux64
87e3ea12ed5d / 8.0a1 / 20110809030751 / files
nightly mac
87e3ea12ed5d / 8.0a1 / 20110809030751 / files
nightly win32
87e3ea12ed5d / 8.0a1 / 20110809030751 / files
nightly win64
87e3ea12ed5d / 8.0a1 / 20110809030751 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 676361 Plugin hangs when content's script accesses plugin at mouse wheel event which wasn't consumed by the plugin r=jimm
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -7672,45 +7672,49 @@ nsWindow::OnMouseWheel(UINT aMsg, WPARAM
       if (!wnd) {
         return;
       }
     }
 
     NS_ASSERTION(destWindow, "destWindow must not be NULL");
     // If the found window is our plugin window, it means that the message
     // has been handled by the plugin but not consumed.  We should handle the
-    // message on its parent window.
+    // message on its parent window.  However, note that the DOM event may
+    // cause accessing the plugin.  Therefore, we should unlock the plugin
+    // process by using PostMessage().
     if (destWindow->mWindowType == eWindowType_plugin) {
       destWindow = destWindow->GetParentWindow(PR_FALSE);
       NS_ENSURE_TRUE(destWindow, );
     }
     UINT internalMessage = GetInternalMessage(aMsg);
-    destWindow->ProcessMessage(internalMessage, aWParam, aLParam, aRetValue);
+    ::PostMessage(destWindow->mWnd, internalMessage, aWParam, aLParam);
     return;
   }
 
   // If the window under cursor is not in our process, it means:
   // 1. The window may be a plugin window (GeckoPluginWindow or its descendant).
   // 2. The window may be another application's window.
   HWND pluginWnd = FindOurProcessWindow(underCursorWnd);
   if (!pluginWnd) {
     // If there is no plugin window in ancestors of the window under cursor,
     // the window is for another applications (case 2).
     // We don't need to handle this message.
     return;
   }
 
   // If we're a plugin window (MozillaWindowClass) and cursor in this window,
   // the message shouldn't go to plugin's wndproc again.  So, we should handle
-  // it on parent window.
+  // it on parent window.  However, note that the DOM event may cause accessing
+  // the plugin.  Therefore, we should unlock the plugin process by using
+  // PostMessage().
   if (mWindowType == eWindowType_plugin && pluginWnd == mWnd) {
     nsWindow* destWindow = GetParentWindow(PR_FALSE);
     NS_ENSURE_TRUE(destWindow, );
     UINT internalMessage = GetInternalMessage(aMsg);
-    destWindow->ProcessMessage(internalMessage, aWParam, aLParam, aRetValue);
+    ::PostMessage(destWindow->mWnd, internalMessage, aWParam, aLParam);
     return;
   }
 
   // If the window is a part of plugin, we should post the message to it.
   ::PostMessage(underCursorWnd, aMsg, aWParam, aLParam);
 }
 
 /**