Remove a function for posting tasks to the global queue on MacOS/iOS and make it private.

Since `PostTaskToGlobalQueue` is somewhat different from
other TaskQueue APIs, there are concerns that it should not be
a public API.

Remove this from task_queue_gcd.h and make it a private static function
of AsyncResolver.

Bug: webrtc:13237
Change-Id: Ib4aff296f894a4f3b051969d176369e13a10088f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234900
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35236}
This commit is contained in:
Byoungchan Lee
2021-10-12 22:53:35 +09:00
committed by WebRTC LUCI CQ
parent d7dd0aa9ee
commit 08438fcd9a
4 changed files with 24 additions and 30 deletions

View File

@ -145,24 +145,10 @@ class TaskQueueGcdFactory final : public TaskQueueFactory {
}
};
// static
void GlobalGcdRunTask(void* context) {
std::unique_ptr<QueuedTask> task(static_cast<QueuedTask*>(context));
task->Run();
}
} // namespace
std::unique_ptr<TaskQueueFactory> CreateTaskQueueGcdFactory() {
return std::make_unique<TaskQueueGcdFactory>();
}
void PostTaskToGlobalQueue(std::unique_ptr<QueuedTask> task,
TaskQueueFactory::Priority priority) {
dispatch_queue_global_t global_queue =
dispatch_get_global_queue(TaskQueuePriorityToGCD(priority), 0);
QueuedTask* context = task.release();
dispatch_async_f(global_queue, context, &GlobalGcdRunTask);
}
} // namespace webrtc