Bug 1183651 - Avoid operating refcount of fullscreen task runnable inside the transition thread. r=jimm

--HG--
extra : source : df714d699348ea188ec6e2456560c60ce600408a
This commit is contained in:
Xidorn Quan 2015-07-16 09:54:19 +10:00
parent 3b99269432
commit 5963d09c4e

View File

@ -2866,16 +2866,15 @@ FullscreenTransitionWindowProc(HWND hWnd, UINT uMsg,
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: