Make MessageQueue processing an optional feature of FakeClock

This is used to avoid thread processing in simulated time
controller. This saves up to 30% execution time in debug builds.

Bug: webrtc:10365
Change-Id: Ie83dfb2468d371e4687d28c776acf7e23eb411d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133173
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27666}
This commit is contained in:
Sebastian Jansson
2019-04-17 10:36:03 +02:00
committed by Commit Bot
parent 8a7dcb163e
commit d624c3903c
12 changed files with 82 additions and 48 deletions

View File

@ -37,7 +37,7 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
// This constructor needs to be used if the test uses a fake clock and
// ProcessMessagesUntilIdle, since ProcessMessagesUntilIdle needs a way of
// advancing time.
explicit VirtualSocketServer(FakeClock* fake_clock);
explicit VirtualSocketServer(ThreadProcessingFakeClock* fake_clock);
~VirtualSocketServer() override;
// The default route indicates which local address to use when a socket is
@ -263,7 +263,7 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
// May be null if the test doesn't use a fake clock, or it does but doesn't
// use ProcessMessagesUntilIdle.
FakeClock* fake_clock_ = nullptr;
ThreadProcessingFakeClock* fake_clock_ = nullptr;
// Used to implement Wait/WakeUp.
Event wakeup_;