In case of multiple "resource" manifest entries for the same keyword, the
last registered one now takes precedence, like any other chrome manifest
entry.
This patch adds another implementation of BaseTimeDuration's ValueCalculator
template parameter that is careful to preserve Forever/-Forever values when
performing arithmetic.
It also defines a typedef for a specialization of BaseTimeDuration that uses
this new ValueCalculator definition.
This patch builds on the templatization from the previous patch to move
arithmetic on the mValue member of BaseTimeDuration to the ValueCalculator
template parameter.
This patch prepares the way for having a separate StickyTimeDuration class
by factoring TimeDuration into a templated base class: BaseTimeDuration.
BaseTimeDuration takes a templated parameter, ValueCalculator, which is a helper
object that defines how various arithmetic operations are performed on its
mValue member (an int64_t count of ticks).
This patch does not actually define or use the ValueCalculator parameter yet but
simply performs the renaming and templatization.
With regards to the templatization, arithmetic operators are defined to take
objects with the same ValueCalculator template parameter (so that we don't, for
example, apply non-safe arithmetic to a StickyTimeDuration).
However, comparison operators are defined to also operate on objects with
a different ValueCalculator template parameter since comparison should be
independent of the type of arithmetic used.
Likewise, the constructor and assignment operator are defined to operate on
objects with a different ValueCalculator template parameter so that objects can
be converted from TimeDuration to StickyTimeDuration and vice-versa.
The constructor is marked as explicit, however, so that we don't silently
convert a StickyTimeDuration to a TimeDuration and unwittingly apply
non-safe arithmetic to a StickyTimeDuration.
TimeDuration is defined as a specialization of BaseTimeDuration that uses
TimeDurationValueCalculator as its ValueCalculator type.
TimeDurationValueCalculator is filled-in in a subsequent patch.
Now that the implementation of a number of TimeDuration methods have been
delegated to a separate TimeDurationPlatformUtils class, it is easier to add
consistent handling to the parameters passed to and from those methods.
This patch adds checks when converting between TimeDurations and doubles so that
Forever (represented by a tick count of INT64_MAX) is paired with
PositiveInfinity, and INT64_MIN is paired with NegativeInfinity.
In order to have different templated versions of TimeDuration we first split out
the platform-specific code so that this code doesn't need to concern itself with
templates (and because putting template code in .cpp files is messy).
The nsCategoryManager singleton lives until very late in shutdown, so the unregister always fails.
It is okay to make it a strong reporter because it will always outlive the memory reporter manager anyways.