Backing out f4ddfbf313fc (bug 905405) on a CLOSED TREE

This commit is contained in:
Robert O'Callahan 2013-09-19 17:16:17 +12:00
Родитель 6355ddd089
Коммит 066b8b3045
2 изменённых файлов: 6 добавлений и 18 удалений

Просмотреть файл

@ -161,12 +161,9 @@ nsAppShell::ScheduleNativeEventCallback()
{
// Post a message to the hidden message window
NS_ADDREF_THIS(); // will be released when the event is processed
{
MutexAutoLock lock(mLastNativeEventScheduledMutex);
// Time stamp this event so we can detect cases where the event gets
// dropping in sub classes / modal loops we do not control.
mLastNativeEventScheduled = TimeStamp::NowLoRes();
}
// Time stamp this event so we can detect cases where the event gets
// dropping in sub classes / modal loops we do not control.
mLastNativeEventScheduled = TimeStamp::NowLoRes();
::PostMessage(mEventWnd, sAppShellGeckoMsgId, 0, reinterpret_cast<LPARAM>(this));
}
@ -241,13 +238,8 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
static const mozilla::TimeDuration nativeEventStarvationLimit =
mozilla::TimeDuration::FromSeconds(NATIVE_EVENT_STARVATION_LIMIT);
TimeDuration timeSinceLastNativeEventScheduled;
{
MutexAutoLock lock(mLastNativeEventScheduledMutex);
timeSinceLastNativeEventScheduled =
TimeStamp::NowLoRes() - mLastNativeEventScheduled;
}
if (timeSinceLastNativeEventScheduled > nativeEventStarvationLimit) {
if ((TimeStamp::NowLoRes() - mLastNativeEventScheduled) >
nativeEventStarvationLimit) {
ScheduleNativeEventCallback();
}

Просмотреть файл

@ -9,7 +9,6 @@
#include "nsBaseAppShell.h"
#include <windows.h>
#include "mozilla/TimeStamp.h"
#include "mozilla/Mutex.h"
// The maximum time we allow before forcing a native event callback.
// In seconds.
@ -23,8 +22,7 @@ class nsAppShell : public nsBaseAppShell
public:
nsAppShell() :
mEventWnd(NULL),
mNativeCallbackPending(false),
mLastNativeEventScheduledMutex("nsAppShell::mLastNativeEventScheduledMutex")
mNativeCallbackPending(false)
{}
typedef mozilla::TimeStamp TimeStamp;
@ -45,8 +43,6 @@ protected:
protected:
HWND mEventWnd;
bool mNativeCallbackPending;
Mutex mLastNativeEventScheduledMutex;
TimeStamp mLastNativeEventScheduled;
};