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}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index a1969ca..d95f749 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -538,6 +538,7 @@
]
deps = [
":simulated_network_api",
+ ":time_controller",
"../call:simulated_network",
"../rtc_base",
"test/network_emulation",
@@ -547,6 +548,24 @@
]
}
+rtc_source_set("time_controller") {
+ visibility = [ "*" ]
+ sources = [
+ "test/time_controller.cc",
+ "test/time_controller.h",
+ ]
+
+ deps = [
+ "../modules/utility",
+ "../rtc_base",
+ "../rtc_base/synchronization:yield_policy",
+ "../system_wrappers",
+ "task_queue",
+ "units:time_delta",
+ "units:timestamp",
+ ]
+}
+
rtc_source_set("fec_controller_api") {
visibility = [ "*" ]
sources = [
@@ -913,29 +932,6 @@
]
}
- rtc_library("time_controller") {
- visibility = [ "*" ]
- testonly = true
- sources = [ "test/time_controller.h" ]
-
- deps = [
- "../modules:module_api",
- "../modules/utility:utility",
- "../rtc_base",
- "../rtc_base:rtc_base_tests_utils",
- "../rtc_base:rtc_event",
- "../rtc_base/synchronization:sequence_checker",
- "../rtc_base/synchronization:yield_policy",
- "../rtc_base/task_utils:to_queued_task",
- "../system_wrappers",
- "task_queue",
- "task_queue:default_task_queue_factory",
- "units:time_delta",
- "units:timestamp",
- "//third_party/abseil-cpp/absl/strings",
- ]
- }
-
rtc_library("create_time_controller") {
visibility = [ "*" ]
testonly = true