Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: webrtc/base/timeutils.cc

Issue 2024813004: Improving the fake clock and using it to fix a flaky STUN timeout test. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing another TSan warning. WebRtcSession wasn't completely shut down. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/base/timeutils.cc
diff --git a/webrtc/base/timeutils.cc b/webrtc/base/timeutils.cc
index ecd0911a510dde654177bb368108d189ccc04645..3c89d808b39f97f6e2a8ace502c04d769269670d 100644
--- a/webrtc/base/timeutils.cc
+++ b/webrtc/base/timeutils.cc
@@ -32,8 +32,10 @@ namespace rtc {
ClockInterface* g_clock = nullptr;
-void SetClock(ClockInterface* clock) {
+ClockInterface* SetClockForTesting(ClockInterface* clock) {
+ ClockInterface* prev = g_clock;
g_clock = clock;
+ return prev;
}
uint64_t TimeNanos() {

Powered by Google App Engine
This is Rietveld 408576698