Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2017 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 WEBRTC_RTC_BASE_TASK_QUEUE_IMPL_FACTORY_H_ | |
| 12 #define WEBRTC_RTC_BASE_TASK_QUEUE_IMPL_FACTORY_H_ | |
| 13 | |
| 14 #include "webrtc/rtc_base/scoped_ref_ptr.h" | |
| 15 #include "webrtc/rtc_base/task_queue.h" | |
| 16 #include "webrtc/rtc_base/task_queue_impl.h" | |
| 17 | |
| 18 namespace rtc { | |
| 19 | |
| 20 class TaskQueueImplFactory { | |
| 21 public: | |
| 22 virtual ~TaskQueueImplFactory() = default; | |
| 23 | |
| 24 virtual scoped_refptr<TaskQueueImpl> CreateImpl( | |
|
nisse-webrtc
2017/08/18 11:45:45
Naming: I'd prefer any of CreateTaskQueueImpl, Cre
| |
| 25 const char* queue_name, | |
| 26 TaskQueue* queue, // only used for GetCurrent() | |
| 27 TaskQueue::Priority priority) = 0; | |
| 28 | |
| 29 virtual TaskQueue* CurrentQueue() = 0; | |
| 30 | |
| 31 // Sets the factory to be used by this process. May only be called once | |
| 32 // before any TaskQueues are created. | |
| 33 static void Set(TaskQueueImplFactory* factory); | |
| 34 static TaskQueueImplFactory* Get(); | |
| 35 }; | |
| 36 | |
| 37 #if defined(WEBRTC_LINUX) | |
| 38 class TaskQueueLibEventFactory : public TaskQueueImplFactory { | |
|
kwiberg-webrtc
2017/08/21 09:21:55
Does this class definition need to be here, in a h
| |
| 39 public: | |
| 40 TaskQueueLibEventFactory() = default; | |
| 41 ~TaskQueueLibEventFactory() override = default; | |
|
kwiberg-webrtc
2017/08/21 09:21:55
Do you need these two?
| |
| 42 // TaskQueueLibEventFactory is neither copyable nor movable. | |
| 43 TaskQueueLibEventFactory(const TaskQueueLibEventFactory&) = delete; | |
| 44 TaskQueueLibEventFactory& operator=(const TaskQueueLibEventFactory&) = delete; | |
|
kwiberg-webrtc
2017/08/21 09:21:55
I don't think you need these two. Copying or movin
| |
| 45 | |
| 46 scoped_refptr<TaskQueueImpl> CreateImpl( | |
| 47 const char* queue_name, | |
| 48 TaskQueue* queue, | |
| 49 TaskQueue::Priority priority) override; | |
| 50 | |
| 51 TaskQueue* CurrentQueue() override; | |
| 52 }; | |
| 53 #endif | |
| 54 | |
| 55 } // namespace rtc | |
| 56 #endif // WEBRTC_RTC_BASE_TASK_QUEUE_IMPL_FACTORY_H_ | |
| OLD | NEW |