Mirko Bonadei 57574ea577 Fix potentially negative Timestamp in logs.
This bug was activated by [1] when we started to store the timestamp
in the webrtc::Timestamp class (causing an RTC_DCHECK to trigger) but
it has been in the codebase for long time (but without using
webrtc::Timestamp the RTC_DCHECK was not triggered).

Basically, LogStartTime() can be called externally to create a baseline
for logging but if that is not the case, LogMessage should call it [2]
and initialise the baseline.

This was happening in reverse order, causing the first LogMessage to
call LogStartTime() after the SystemTimeMillis(), causing a negative
time difference that when gets wrapped into webrtc::Timestamp triggers
the RTC_DCHECK [3].


[1] - https://webrtc-review.googlesource.com/c/src/+/269249
[2] - https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/rtc_base/logging.h;l=493-497;drc=821b92a66ed661714cc21020b5a045fcd18d0176
[3] - https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/rtc_base/units/unit_base.h;l=122;drc=6dcd43f1e4f2f3ec0bd844cd45e011e9c4d16e38

Bug: b/238157120
Change-Id: I891799316503030c0df5e10e759a61dfc5e1ab3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271582
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37770}
2022-08-12 19:54:33 +00:00
..
2022-06-28 08:32:13 +00:00
2021-09-21 16:28:38 +00:00
2021-09-21 16:28:38 +00:00
2022-06-28 08:32:13 +00:00
2022-06-07 07:14:06 +00:00
2022-01-28 15:13:45 +00:00
2022-05-11 14:37:04 +00:00
2022-05-11 14:37:04 +00:00
2021-08-31 14:27:49 +00:00
2019-11-26 14:05:20 +00:00
2021-04-22 13:04:53 +00:00
2021-04-16 08:47:17 +00:00
2021-09-21 15:17:26 +00:00
2022-01-25 15:39:53 +00:00
2021-02-10 15:04:55 +00:00
2021-10-13 19:26:10 +00:00