/* -*- 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/. */
if (profiler_thread_is_being_profiled(ThreadProfilingFeatures::Sampling)) { // check to see if the profiler has been enabled since the last PutEvent while (mDispatchTimes.Count() < mQueue.Count()) {
mDispatchTimes.Push(TimeStamp());
}
mDispatchTimes.Push(aDelay ? TimeStamp::Now() - *aDelay : TimeStamp::Now());
}
profiler_add_marker("EventQueueInternal::PutEvent",
baseprofiler::category::OTHER, MarkerTiming::InstantNow(),
FlowMarker{}, Flow::FromPointer(event.get()));
// We always want to clear the dispatch times, even if the profiler is turned // off, because we want to empty the (previously-collected) dispatch times, if // any, from when the profiler was turned on. We only want to do something // interesting with the dispatch times if the profiler is turned on, though. if (!mDispatchTimes.IsEmpty()) {
TimeStamp dispatch_time = mDispatchTimes.Pop(); if (profiler_is_active()) { if (!dispatch_time.IsNull()) { if (aLastEventDelay) {
*aLastEventDelay = TimeStamp::Now() - dispatch_time;
}
}
}
} elseif (profiler_is_active()) { if (aLastEventDelay) { // if we just turned on the profiler, we don't have dispatch // times for events already in the queue.
*aLastEventDelay = TimeDuration();
}
}
nsCOMPtr<nsIRunnable> result = mQueue.Pop(); return result.forget();
}
namespace mozilla { templateclass EventQueueSized<16>; // Used by ThreadEventQueue templateclass EventQueueSized<64>; // Used by ThrottledEventQueue namespace detail { templateclass EventQueueInternal<16>; // Used by ThreadEventQueue templateclass EventQueueInternal<64>; // Used by ThrottledEventQueue
} // namespace detail
} // namespace mozilla
¤ Dauer der Verarbeitung: 0.0 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.