This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.
MozReview-Commit-ID: 99648Lm46T5
This was automatically generated by the script modeline.py.
MozReview-Commit-ID: BgulzkGteAL
--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
This will allow us to schedule these timers differently in the future.
This patch only performs the refactoring, and is not intended to change
any behavior. Specifically, this patch doesn't change the order in
which timeouts are fired -- they should still all be fired according to
the mWhen field.
The implementation works by splitting timeout storage per window into
two Timeouts objects, mNormalTimeouts and mTrackingTimeouts. The ForEach
helper methods are extended to deal with both of these objects, and as a
result, most of the algorithms operating on the list of timeouts work
correctly without any modification, with the notable exception of
RunTimeout.
In RunTimeout(), the order in which Timeout objects are processed does
matter, so for that case we use the OrderedTimeoutIterator class to
iterate over both linked lists simultaneously in the mWhen order. Also,
inserting the dummy timeout when running the timeouts is only necessary
for the linked list where the last expired timeout is coming from, so we
only inject the dummy timer into the corresponding list, therefore we
remember which list we picked the last expired timeout from when
looking for it.
The requestIdleCallback feature behaves in many ways as setTimeout
since it takes an optional timout when the idle callback will be
called regardless of the user agent being idle or not. This means that
the same mechanisms controlling setTimeout are needed for
requestIdleCallback.
MozReview-Commit-ID: 9mESsJnUexf
--HG--
extra : rebase_source : 16376c8097a27ab4b5b0e74a2e658f33295703bf
The requestIdleCallback feature behaves in many ways as setTimeout
since it takes an optional timout when the idle callback will be
called regardless of the user agent being idle or not. This means that
the same mechanisms controlling setTimeout are needed for
requestIdleCallback.
MozReview-Commit-ID: 9mESsJnUexf
--HG--
extra : rebase_source : 82d92f515f24e08fe7da78afe7185c8ceb98a096