mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 911889. Part 5. Add API to detect whether an nsRefreshDriver is in the middle of a refresh. r=dbaron
--HG-- extra : rebase_source : 3cb0dccfe176b5f6d79fd0898ddf6e5a8bed2e39
This commit is contained in:
parent
773422aedd
commit
cf55753bd6
@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
@ -685,7 +685,8 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext)
|
||||
mThrottled(false),
|
||||
mTestControllingRefreshes(false),
|
||||
mViewManagerFlushIsPending(false),
|
||||
mRequestedHighPrecision(false)
|
||||
mRequestedHighPrecision(false),
|
||||
mInRefresh(false)
|
||||
{
|
||||
mMostRecentRefreshEpochTime = JS_Now();
|
||||
mMostRecentRefresh = TimeStamp::Now();
|
||||
@ -1061,6 +1062,9 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
|
||||
profiler_tracing("Paint", "RD", TRACING_INTERVAL_START);
|
||||
|
||||
AutoRestore<bool> restoreInRefresh(mInRefresh);
|
||||
mInRefresh = true;
|
||||
|
||||
/*
|
||||
* The timer holds a reference to |this| while calling |Notify|.
|
||||
* However, implementations of |WillRefresh| are permitted to destroy
|
||||
@ -1220,6 +1224,8 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
mPostRefreshObservers[i]->DidRefresh();
|
||||
}
|
||||
profiler_tracing("Paint", "RD", TRACING_INTERVAL_END);
|
||||
|
||||
NS_ASSERTION(mInRefresh, "Still in refresh");
|
||||
}
|
||||
|
||||
/* static */ PLDHashOperator
|
||||
|
@ -249,6 +249,8 @@ public:
|
||||
*/
|
||||
static int32_t DefaultInterval();
|
||||
|
||||
bool IsInRefresh() { return mInRefresh; }
|
||||
|
||||
private:
|
||||
typedef nsTObserverArray<nsARefreshObserver*> ObserverArray;
|
||||
typedef nsTHashtable<nsISupportsHashKey> RequestTable;
|
||||
@ -302,6 +304,7 @@ private:
|
||||
bool mTestControllingRefreshes;
|
||||
bool mViewManagerFlushIsPending;
|
||||
bool mRequestedHighPrecision;
|
||||
bool mInRefresh;
|
||||
|
||||
int64_t mMostRecentRefreshEpochTime;
|
||||
mozilla::TimeStamp mMostRecentRefresh;
|
||||
|
Loading…
Reference in New Issue
Block a user