mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
Backing out f4ddfbf313fc (bug 905405) on a CLOSED TREE
This commit is contained in:
parent
6355ddd089
commit
066b8b3045
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user