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

Unified Diff: webrtc/base/fakeclock.cc

Issue 2038213002: Revert of 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: 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
« no previous file with comments | « webrtc/base/fakeclock.h ('k') | webrtc/base/gunit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/fakeclock.cc
diff --git a/webrtc/base/fakeclock.cc b/webrtc/base/fakeclock.cc
index bcd720ff742f2687f6c0bb05c5e60672edec6314..e5aa3bc0a4fc3af0aecd8e58b395c54ce48f0d41 100644
--- a/webrtc/base/fakeclock.cc
+++ b/webrtc/base/fakeclock.cc
@@ -27,24 +27,14 @@
time_ = nanos;
}
// If message queues are waiting in a socket select() with a timeout provided
- // by the OS, they should wake up and dispatch all messages that are ready.
- MessageQueueManager::ProcessAllMessageQueues();
+ // by the OS, they should wake up to check if there are any messages ready to
+ // be dispatched based on the fake time.
+ MessageQueueManager::WakeAllMessageQueues();
}
void FakeClock::AdvanceTime(TimeDelta delta) {
- {
- CritScope cs(&lock_);
- time_ += delta.ToNanoseconds();
- }
- MessageQueueManager::ProcessAllMessageQueues();
-}
-
-ScopedFakeClock::ScopedFakeClock() {
- prev_clock_ = SetClockForTesting(this);
-}
-
-ScopedFakeClock::~ScopedFakeClock() {
- SetClockForTesting(prev_clock_);
+ CritScope cs(&lock_);
+ SetTimeNanos(time_ + delta.ToNanoseconds());
}
} // namespace rtc
« no previous file with comments | « webrtc/base/fakeclock.h ('k') | webrtc/base/gunit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698