Bug 1183651 - Avoid operating refcount of fullscreen task runnable inside the transition thread. r=jimm
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 16 Jul 2015 09:54:19 +1000
changeset 253117 79578dac895feb435ca6a0481b75269284812811
parent 253116 613f8e602f8bf976c8aedfca09bb08e6a2d5a525
child 253118 909610f2dfc2c101a28a215ffc3e2156c4d7189a
push id29061
push userryanvm@gmail.com
push dateThu, 16 Jul 2015 18:53:45 +0000
treeherdermozilla-central@a0f4a688433d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1183651
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1183651 - Avoid operating refcount of fullscreen task runnable inside the transition thread. r=jimm
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2861,26 +2861,25 @@ NS_METHOD nsWindow::Invalidate(const nsI
 
 static LRESULT CALLBACK
 FullscreenTransitionWindowProc(HWND hWnd, UINT uMsg,
                                WPARAM wParam, LPARAM lParam)
 {
   switch (uMsg) {
     case WM_FULLSCREEN_TRANSITION_BEFORE:
     case WM_FULLSCREEN_TRANSITION_AFTER: {
-      // The message sender should have added ref for us.
-      nsCOMPtr<nsIRunnable> callback =
-        already_AddRefed<nsIRunnable>((nsIRunnable*)wParam);
       DWORD duration = (DWORD)lParam;
       DWORD flags = AW_BLEND;
       if (uMsg == WM_FULLSCREEN_TRANSITION_AFTER) {
         flags |= AW_HIDE;
       }
       ::AnimateWindow(hWnd, duration, flags);
-      NS_DispatchToMainThread(callback);
+      // The message sender should have added ref for us.
+      NS_DispatchToMainThread(
+        already_AddRefed<nsIRunnable>((nsIRunnable*)wParam));
       break;
     }
     case WM_DESTROY:
       ::PostQuitMessage(0);
       break;
     default:
       return ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
   }