mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1203427 (part 2) - Remove an argument to nsTimeout::InitTimer. r=mccr8.
The first argument to this method is always nsGlobalWindow::TimerCallback, and hard-wiring this makes subsequent patches simpler.
This commit is contained in:
parent
cae6e9971a
commit
8925475dfe
@ -542,6 +542,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsTimeout, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsTimeout, Release)
|
||||
|
||||
nsresult
|
||||
nsTimeout::InitTimer(uint32_t aDelay)
|
||||
{
|
||||
return mTimer->InitWithFuncCallback(nsGlobalWindow::TimerCallback, this,
|
||||
aDelay, nsITimer::TYPE_ONE_SHOT);
|
||||
}
|
||||
|
||||
// Return true if this timeout has a refcount of 1. This is used to check
|
||||
// that dummy_timeout doesn't leak from nsGlobalWindow::RunTimeout.
|
||||
bool
|
||||
@ -12501,7 +12508,7 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
|
||||
|
||||
nsRefPtr<nsTimeout> copy = timeout;
|
||||
|
||||
rv = timeout->InitTimer(TimerCallback, realInterval);
|
||||
rv = timeout->InitTimer(realInterval);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -12757,7 +12764,7 @@ nsGlobalWindow::RescheduleTimeout(nsTimeout* aTimeout, const TimeStamp& now,
|
||||
|
||||
// Reschedule the OS timer. Don't bother returning any error codes if
|
||||
// this fails since the callers of this method don't care about them.
|
||||
nsresult rv = aTimeout->InitTimer(TimerCallback, delay.ToMilliseconds());
|
||||
nsresult rv = aTimeout->InitTimer(delay.ToMilliseconds());
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ERROR("Error initializing timer for DOM timeout!");
|
||||
@ -13057,7 +13064,7 @@ nsresult nsGlobalWindow::ResetTimersForNonBackgroundWindow()
|
||||
timeout->mFiringDepth = firingDepth;
|
||||
timeout->Release();
|
||||
|
||||
nsresult rv = timeout->InitTimer(TimerCallback, delay.ToMilliseconds());
|
||||
nsresult rv = timeout->InitTimer(delay.ToMilliseconds());
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Error resetting non background timer for DOM timeout!");
|
||||
@ -13499,7 +13506,7 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren)
|
||||
t->mTimer = do_CreateInstance("@mozilla.org/timer;1");
|
||||
NS_ENSURE_TRUE(t->mTimer, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
rv = t->InitTimer(TimerCallback, delay);
|
||||
rv = t->InitTimer(delay);
|
||||
if (NS_FAILED(rv)) {
|
||||
t->mTimer = nullptr;
|
||||
return rv;
|
||||
|
@ -159,11 +159,7 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTimeout)
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsTimeout)
|
||||
|
||||
nsresult InitTimer(nsTimerCallbackFunc aFunc, uint32_t aDelay)
|
||||
{
|
||||
return mTimer->InitWithFuncCallback(aFunc, this, aDelay,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
}
|
||||
nsresult InitTimer(uint32_t aDelay);
|
||||
|
||||
bool HasRefCntOne();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user