Bug 550784 - [OOPP] Flash deadlocks during script evals that trigger focus related events. r=bent.
authorJim Mathies <jmathies@mozilla.com>
Wed, 10 Mar 2010 19:15:55 -0600
changeset 39240 7d80d8881cbd3760762316ed69198081523a2d5d
parent 39239 30f4a2cb3959585396dbf5f4ff3c4d1fff3ab9b3
child 39241 5295a7cfd05c8e8f461c9ef86d88014b6b808011
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs550784
milestone1.9.3a3pre
Bug 550784 - [OOPP] Flash deadlocks during script evals that trigger focus related events. r=bent.
ipc/glue/WindowsMessageLoop.cpp
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -355,38 +355,47 @@ NeuteredWindowProc(HWND hwnd,
   }
 
   // See if we care about this message. We may either ignore it, send it to
   // DefWindowProc, or defer it for later.
   return ProcessOrDeferMessage(hwnd, uMsg, wParam, lParam);
 }
 
 static bool
-WindowIsMozillaWindow(HWND hWnd)
+WindowIsDeferredWindow(HWND hWnd)
 {
   if (!IsWindow(hWnd)) {
     NS_WARNING("Window has died!");
     return false;
   }
 
   PRUnichar buffer[256] = { 0 };
   int length = GetClassNameW(hWnd, (wchar_t*)buffer, sizeof(buffer) - 1);
   if (length <= 0) {
     NS_WARNING("Failed to get class name!");
     return false;
   }
 
+  // Common mozilla windows we must defer messages to.
   nsDependentString className(buffer, length);
   if (StringBeginsWith(className, NS_LITERAL_STRING("Mozilla")) ||
       StringBeginsWith(className, NS_LITERAL_STRING("Gecko")) ||
       className.EqualsLiteral("nsToolkitClass") ||
       className.EqualsLiteral("nsAppShell:EventWindowClass")) {
     return true;
   }
 
+  // Plugin windows that can trigger ipc calls in child:
+  // 'ShockwaveFlashFullScreen' - flash fullscreen window
+  // 'AGFullScreenWinClass' - silverlight fullscreen window
+  if (className.EqualsLiteral("ShockwaveFlashFullScreen") ||
+      className.EqualsLiteral("AGFullScreenWinClass")) {
+    return true;
+  }
+
   // nsNativeAppSupport makes a window like "FirefoxMessageWindow" based on the
   // toolkit app's name. It's pretty expensive to calculate this so we only try
   // once.
   if (gAppMessageWindowNameLength == 0) {
     nsCOMPtr<nsIXULAppInfo> appInfo =
       do_GetService("@mozilla.org/xre/app-info;1");
     if (appInfo) {
       nsCAutoString appName;
@@ -411,17 +420,17 @@ WindowIsMozillaWindow(HWND hWnd)
   }
 
   return false;
 }
 
 bool
 NeuterWindowProcedure(HWND hWnd)
 {
-  if (!WindowIsMozillaWindow(hWnd)) {
+  if (!WindowIsDeferredWindow(hWnd)) {
     // Some other kind of window, skip.
     return false;
   }
 
   NS_ASSERTION(!GetProp(hWnd, kOldWndProcProp), "This should always be null!");
 
   // It's possible to get NULL out of SetWindowLongPtr, and the only way to know
   // if that's a valid old value is to use GetLastError. Clear the error here so
@@ -450,18 +459,18 @@ NeuterWindowProcedure(HWND hWnd)
   }
 
   return true;
 }
 
 void
 RestoreWindowProcedure(HWND hWnd)
 {
-  NS_ASSERTION(WindowIsMozillaWindow(hWnd),
-               "Not a mozilla window, this shouldn't be in our list!");
+  NS_ASSERTION(WindowIsDeferredWindow(hWnd),
+               "Not a deferred window, this shouldn't be in our list!");
 
   LONG_PTR oldWndProc = (LONG_PTR)RemoveProp(hWnd, kOldWndProcProp);
   if (oldWndProc) {
     NS_ASSERTION(oldWndProc != (LONG_PTR)NeuteredWindowProc,
                  "This shouldn't be possible!");
 
     LONG_PTR currentWndProc =
       SetWindowLongPtr(hWnd, GWLP_WNDPROC, oldWndProc);