Danil Chapovalov | b4c6d1e | 2019-01-21 13:52:59 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 11 | #ifndef API_TASK_QUEUE_TASK_QUEUE_IMPL_H_ |
| 12 | #define API_TASK_QUEUE_TASK_QUEUE_IMPL_H_ |
| 13 | |
| 14 | #include <memory> |
| 15 | |
| 16 | #include "api/task_queue/queued_task.h" |
| 17 | #include "rtc_base/task_queue.h" |
| 18 | |
| 19 | // TODO(danilchap): Remove Impl and dependency on rtc::TaskQueue when custom |
| 20 | // implementations switch to use global factories that creates TaskQueue |
| 21 | // instead of using link-time injection. |
| 22 | class rtc::TaskQueue::Impl { |
| 23 | public: |
| 24 | virtual void Delete() = 0; |
| 25 | virtual void PostTask(std::unique_ptr<QueuedTask> task) = 0; |
| 26 | virtual void PostDelayedTask(std::unique_ptr<QueuedTask> task, |
| 27 | uint32_t milliseconds) = 0; |
| 28 | |
| 29 | void AddRef(); |
| 30 | void Release(); |
| 31 | |
| 32 | protected: |
| 33 | virtual ~Impl() = default; |
| 34 | |
| 35 | private: |
| 36 | friend class rtc::TaskQueue; |
| 37 | rtc::TaskQueue* task_queue_ = nullptr; |
| 38 | }; |
| 39 | |
| 40 | #endif // API_TASK_QUEUE_TASK_QUEUE_IMPL_H_ |