Bug 1243636. Switch to gfx::CriticalSection

This commit is contained in:
Jeff Muizelaar 2016-01-26 11:14:46 -05:00
parent a0112e3e9a
commit 5150171f15
2 changed files with 6 additions and 7 deletions

View File

@ -460,7 +460,6 @@ nsWindow::nsWindow()
mIdleService = nullptr;
::InitializeCriticalSection(&mPresentLock);
mSizeConstraintsScale = GetDefaultScale().scale;
sInstanceCount++;
@ -497,7 +496,6 @@ nsWindow::~nsWindow()
sIsOleInitialized = FALSE;
}
}
::DeleteCriticalSection(&mPresentLock);
NS_IF_RELEASE(mNativeDragTarget);
}
@ -4967,13 +4965,13 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
//
// To do this we take mPresentLock in nsWindow::PreRender and
// if that lock is taken we wait before doing WM_SETTEXT
EnterCriticalSection(&mPresentLock);
mPresentLock.Enter();
DWORD style = GetWindowLong(mWnd, GWL_STYLE);
SetWindowLong(mWnd, GWL_STYLE, style & ~WS_VISIBLE);
*aRetValue = CallWindowProcW(GetPrevWindowProc(), mWnd,
msg, wParam, lParam);
SetWindowLong(mWnd, GWL_STYLE, style);
LeaveCriticalSection(&mPresentLock);
mPresentLock.Leave();
return true;
}
@ -7837,13 +7835,13 @@ bool nsWindow::PreRender(LayerManagerComposite*)
// Using PreRender is unnecessarily pessimistic because
// we technically only need to block during the present call
// not all of compositor rendering
EnterCriticalSection(&mPresentLock);
mPresentLock.Enter();
return true;
}
void nsWindow::PostRender(LayerManagerComposite*)
{
LeaveCriticalSection(&mPresentLock);
mPresentLock.Leave();
}
bool

View File

@ -25,6 +25,7 @@
#include "nsITimer.h"
#include "nsRegion.h"
#include "mozilla/EventForwards.h"
#include "mozilla/gfx/CriticalSection.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/TimeStamp.h"
#include "nsMargin.h"
@ -628,7 +629,7 @@ protected:
static bool sNeedsToInitMouseWheelSettings;
static void InitMouseWheelScrollData();
CRITICAL_SECTION mPresentLock;
mozilla::gfx::CriticalSection mPresentLock;
double mSizeConstraintsScale; // scale in effect when setting constraints
};