/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
mSubmitTime = aBaseTime; if (profiler_is_active()) {
mCause = profiler_capture_backtrace();
}
// If we are frozen simply set mTimeRemaining to be the "time remaining" in // the timeout (i.e., the interval itself). This will be used to create a // new mWhen time when the window is thawed. The end effect is that time does // not appear to pass for frozen windows. if (mGlobal->IsFrozen()) {
mWhen = TimeStamp();
mTimeRemaining = aDelay; return;
}
// Since we are not frozen we must set a precise mWhen target wakeup // time. Even if we are suspended we want to use this target time so // that it appears time passes while suspended.
mWhen = aBaseTime + aDelay;
mTimeRemaining = TimeDuration(0);
}
const TimeStamp& Timeout::When() const {
MOZ_DIAGNOSTIC_ASSERT(!mWhen.IsNull()); // Note, mGlobal->IsFrozen() can be true here. The Freeze() method calls // When() to calculate the delay to populate mTimeRemaining. return mWhen;
}
const TimeDuration& Timeout::TimeRemaining() const {
MOZ_DIAGNOSTIC_ASSERT(mWhen.IsNull()); // Note, mGlobal->IsFrozen() can be false here. The Thaw() method calls // TimeRemaining() to calculate the new When() value. return mTimeRemaining;
}
} // namespace mozilla::dom
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.