Moves ownership of time controller into NetworkEmulationManager.
This makes it easier to maintain consistency between real time and simulated time modes. The RealTimeController is updated to use an explicit main thread, this ensures that pending destruction tasks are run as the network emulator goes out of scope. Bug: webrtc:11255 Change-Id: Ie73ab778c78a68d7c58c0f857f14a8d8ac027c67 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166164 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30342}
This commit is contained in:
committed by
Commit Bot
parent
402379f1f3
commit
6ce033a863
@ -16,6 +16,7 @@
|
||||
|
||||
#include "api/test/network_emulation/network_emulation_interfaces.h"
|
||||
#include "api/test/simulated_network.h"
|
||||
#include "api/test/time_controller.h"
|
||||
|
||||
#include "api/units/timestamp.h"
|
||||
#include "rtc_base/network.h"
|
||||
@ -69,6 +70,8 @@ class EmulatedNetworkManagerInterface {
|
||||
std::function<void(EmulatedNetworkStats)> stats_callback) const = 0;
|
||||
};
|
||||
|
||||
enum class TimeMode { kRealTime, kSimulated };
|
||||
|
||||
// Provides an API for creating and configuring emulated network layer.
|
||||
// All objects returned by this API are owned by NetworkEmulationManager itself
|
||||
// and will be deleted when manager will be deleted.
|
||||
@ -103,6 +106,8 @@ class NetworkEmulationManager {
|
||||
};
|
||||
virtual ~NetworkEmulationManager() = default;
|
||||
|
||||
virtual TimeController* time_controller() = 0;
|
||||
|
||||
// Creates an emulated network node, which represents single network in
|
||||
// the emulated network layer.
|
||||
virtual EmulatedNetworkNode* CreateEmulatedNode(
|
||||
|
||||
Reference in New Issue
Block a user