The way we use `operator/` on TimeUnit is usaually to divide 2 for the fuzz or to divide the playback rate, and the rate is always a unsigned int.
The `operator%` should also have same constraint, because there is meaningless to do such a operation on a negative value.
Differential Revision: https://phabricator.services.mozilla.com/D37310
--HG--
extra : moz-landing-system : lando
As operator`%` would need to handle `TimeUnit` as a input as well, we add new operator function.
Also use `int64` as a input parameter for another two operator functions `%` and `/` in order to add assertion to ensure that the input won't overflow.
Differential Revision: https://phabricator.services.mozilla.com/D27644
--HG--
extra : moz-landing-system : lando
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
If TimeUnits.h includes mozilla/dom/TimeRanges.h, then the build ends up
pulling in the Gecko DOM bindings, which pulls in a whole lot of JavaScript and
DOM bindings code. That makes it trickier to import GeckoMedia into Servo, and
makes Gecko's build slower, so move the code to convert TimeIntervals into
dom::TimeRanges.
Also remove an extraneous "virtual" and add "const" to some functions in TimeRanges.
MozReview-Commit-ID: BLeehaf9gCE
--HG--
extra : rebase_source : 84ef054cf8fd5b4434dc761a1b0a39803d3231f5
media::TimeUnit can take its place. We don't want 2 things for the same purpose to cause confusion.
MozReview-Commit-ID: 3z6hbgXFsxP
--HG--
extra : rebase_source : 0b472e351abdc48e337aaf645ae8be467e8a300f
extra : intermediate-source : 4e2156ec04fd30af6cf59adfd1390cf67f411d4c
extra : source : bf5b035c7041a892517373dd566d2a7d7ec60c72
See bug 853398 for the reason to block double multiplier which is slower and
less precise for large values. Also we remove the friend functions of
operator* because it is easy to cause overloading ambiguity when making
them templates.
MozReview-Commit-ID: FhIWSHDd41b
--HG--
extra : rebase_source : e9fec65dfb0b077dd7f962eb20af719c0dc76df8
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
I contemplated using the mIsValid bit on CheckedInt for nullability, but
eventually decided that it's too much of an overload. typedef-ing a Maybe<>
solves things nicely.
The current clash between the constants makes it impossible to do using
|using namespace mozilla::media;| in most cpp files. It would be nice to
put the constants in mozilla::media, but that requires updating a bunch of
files, so I'm not doing it now.
We use the value INT64_MAX as meaning infinity. This allows to avoid taking
more storage space than necessary but may result in unpredictable behaviour
when performing calculations.