From b249c54209447135a58ce606b0cb9d7bbd4ab85b Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Mon, 8 Jul 2019 09:28:10 +0200 Subject: [PATCH] Delete GlobalTaskQueueFactory as now unused Bug: webrtc:10284 Change-Id: I80fd75b0bd306a26e0c022047551587ee5fd08cd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144781 Reviewed-by: Mirko Bonadei Reviewed-by: Karl Wiberg Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#28516} --- BUILD.gn | 1 - api/task_queue/BUILD.gn | 22 ------------ api/task_queue/global_task_queue_factory.cc | 40 --------------------- api/task_queue/global_task_queue_factory.h | 27 -------------- modules/video_coding/BUILD.gn | 1 - sdk/BUILD.gn | 1 - 6 files changed, 92 deletions(-) delete mode 100644 api/task_queue/global_task_queue_factory.cc delete mode 100644 api/task_queue/global_task_queue_factory.h diff --git a/BUILD.gn b/BUILD.gn index 418ff1ba83..8334573a41 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -480,7 +480,6 @@ if (rtc_include_tests) { "api:rtc_api_unittests", "api/audio/test:audio_api_unittests", "api/audio_codecs/test:audio_codecs_api_unittests", - "api/task_queue:global_task_queue_factory", "api/video/test:rtc_api_video_unittests", "api/video_codecs/test:video_codecs_api_unittests", "call:fake_network_pipe_unittests", diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn index ca41452e23..19b9e0ed2d 100644 --- a/api/task_queue/BUILD.gn +++ b/api/task_queue/BUILD.gn @@ -84,25 +84,3 @@ if (rtc_include_tests) { ] } } - -rtc_source_set("global_task_queue_factory") { - # TODO(bugs.webrtc.org/10284): Remove this target when task queue factory - # propagated to all components that create TaskQueues. - visibility = [ "*" ] - sources = [ - "global_task_queue_factory.cc", - "global_task_queue_factory.h", - ] - deps = [ - ":task_queue", - "../../rtc_base:checks", - ] - - if (build_with_chromium) { - # Chromium uses link-time injection of the CreateDefaultTaskQueueFactory - deps += [ "../../../webrtc_overrides:task_queue_impl" ] - sources += [ "default_task_queue_factory.h" ] - } else { - deps += [ ":default_task_queue_factory" ] - } -} diff --git a/api/task_queue/global_task_queue_factory.cc b/api/task_queue/global_task_queue_factory.cc deleted file mode 100644 index 528d14ddb1..0000000000 --- a/api/task_queue/global_task_queue_factory.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "api/task_queue/global_task_queue_factory.h" - -#include "api/task_queue/default_task_queue_factory.h" -#include "rtc_base/checks.h" - -namespace webrtc { -namespace { - -TaskQueueFactory* GlobalOrDefault(TaskQueueFactory* global) { - static TaskQueueFactory* const factory = - global ? global : CreateDefaultTaskQueueFactory().release(); - return factory; -} - -} // namespace - -void SetGlobalTaskQueueFactory(std::unique_ptr factory) { - RTC_CHECK(factory) << "Can't set nullptr TaskQueueFactory"; - // Own, but never delete the global factory. - TaskQueueFactory* global = factory.release(); - RTC_CHECK(GlobalOrDefault(global) == global) - << "Task queue factory set after another SetFactory or after a task " - "queue was created"; -} - -TaskQueueFactory& GlobalTaskQueueFactory() { - return *GlobalOrDefault(nullptr); -} - -} // namespace webrtc diff --git a/api/task_queue/global_task_queue_factory.h b/api/task_queue/global_task_queue_factory.h deleted file mode 100644 index a58083301d..0000000000 --- a/api/task_queue/global_task_queue_factory.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef API_TASK_QUEUE_GLOBAL_TASK_QUEUE_FACTORY_H_ -#define API_TASK_QUEUE_GLOBAL_TASK_QUEUE_FACTORY_H_ - -#include - -#include "api/task_queue/task_queue_factory.h" - -namespace webrtc { - -// May be called at most once, and before any TaskQueue is created. -void SetGlobalTaskQueueFactory(std::unique_ptr factory); - -// Returns TaskQueue factory. Always returns the same factory. -TaskQueueFactory& GlobalTaskQueueFactory(); - -} // namespace webrtc - -#endif // API_TASK_QUEUE_GLOBAL_TASK_QUEUE_FACTORY_H_ diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 9d0c65b3d1..1e3aadf106 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -153,7 +153,6 @@ rtc_static_library("video_coding") { "..:module_api_public", "../../api:fec_controller_api", "../../api:rtp_headers", - "../../api/task_queue:global_task_queue_factory", "../../api/units:data_rate", "../../api/video:builtin_video_bitrate_allocator_factory", "../../api/video:encoded_frame", diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index ffa4db26e4..c29c3f0205 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -232,7 +232,6 @@ if (is_ios || is_mac) { deps = [ ":audio_device", - "../api/task_queue:global_task_queue_factory", "../modules/audio_device:audio_device_api", "../modules/audio_device:audio_device_generic", "../rtc_base:checks",