dcsctp: Add operators on TimeMs and DurationMs
To be able to use them type-safely, they should support native
operators (e.g. adding a time and a duration, or subtracting two time
values), as the alternative is to manage them as numbers.
Yes, this makes them behave a bit like absl::Time/absl::Duration.
Bug: webrtc:12614
Change-Id: I4dea12e33698a46e71fb549f44c06f2f381c9201
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215143
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33725}
diff --git a/net/dcsctp/timer/timer_test.cc b/net/dcsctp/timer/timer_test.cc
index 263f535..9533234 100644
--- a/net/dcsctp/timer/timer_test.cc
+++ b/net/dcsctp/timer/timer_test.cc
@@ -30,7 +30,7 @@
}
void AdvanceTimeAndRunTimers(DurationMs duration) {
- now_ = TimeMs(*now_ + *duration);
+ now_ = now_ + duration;
for (TimeoutID timeout_id : timeout_manager_.RunTimers()) {
manager_.HandleTimeout(timeout_id);