blob: bbee6ef967a030e71a2ca717fe3cedf41665a633 [file] [log] [blame]
Sebastian Jansson0d617cc2019-03-22 14:22:161/*
2 * Copyright 2019 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#ifndef TEST_TIME_CONTROLLER_REAL_TIME_CONTROLLER_H_
11#define TEST_TIME_CONTROLLER_REAL_TIME_CONTROLLER_H_
12
Danil Chapovalov28de7cf2019-04-12 17:25:0613#include <functional>
Sebastian Jansson0d617cc2019-03-22 14:22:1614#include <memory>
15
Danil Chapovalov28de7cf2019-04-12 17:25:0616#include "api/task_queue/task_queue_factory.h"
Bjorn A Mellemc4f86542019-11-21 18:37:1817#include "api/test/time_controller.h"
Danil Chapovalov28de7cf2019-04-12 17:25:0618#include "api/units/time_delta.h"
19#include "modules/utility/include/process_thread.h"
20#include "system_wrappers/include/clock.h"
Sebastian Jansson0d617cc2019-03-22 14:22:1621
22namespace webrtc {
23class RealTimeController : public TimeController {
24 public:
Danil Chapovalov28de7cf2019-04-12 17:25:0625 RealTimeController();
26
Sebastian Jansson0d617cc2019-03-22 14:22:1627 Clock* GetClock() override;
28 TaskQueueFactory* GetTaskQueueFactory() override;
29 std::unique_ptr<ProcessThread> CreateProcessThread(
30 const char* thread_name) override;
Sebastian Janssonfc8279d2020-01-16 10:45:5931 std::unique_ptr<rtc::Thread> CreateThread(
32 const std::string& name,
33 std::unique_ptr<rtc::SocketServer> socket_server) override;
34 rtc::Thread* GetMainThread() override;
Markus Handell486cc552019-12-03 13:37:2835 void AdvanceTime(TimeDelta duration) override;
Danil Chapovalov28de7cf2019-04-12 17:25:0636
37 private:
Sebastian Janssonfc8279d2020-01-16 10:45:5938 const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
Sebastian Jansson6ce033a2020-01-22 09:12:5639 const std::unique_ptr<rtc::Thread> main_thread_;
Sebastian Jansson0d617cc2019-03-22 14:22:1640};
41
Sebastian Jansson0d617cc2019-03-22 14:22:1642} // namespace webrtc
43
44#endif // TEST_TIME_CONTROLLER_REAL_TIME_CONTROLLER_H_