diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 951865dde1..572d224126 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -559,7 +559,6 @@ if (is_win) { } rtc_source_set("rtc_task_queue_stdlib") { - visibility = [ "../api/task_queue:default_task_queue_factory" ] sources = [ "task_queue_stdlib.cc", "task_queue_stdlib.h", diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 862d59d8e2..aeb79a1330 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -15,7 +15,9 @@ rtc_static_library("webrtc_fuzzer_main") { "webrtc_fuzzer_main.cc", ] deps = [ + "../../api/task_queue:global_task_queue_factory", "../../rtc_base:rtc_base_approved", + "../../rtc_base:rtc_task_queue_stdlib", "//testing/libfuzzer:libfuzzer_main", ] diff --git a/test/fuzzers/webrtc_fuzzer_main.cc b/test/fuzzers/webrtc_fuzzer_main.cc index a52dd231be..3e05be632a 100644 --- a/test/fuzzers/webrtc_fuzzer_main.cc +++ b/test/fuzzers/webrtc_fuzzer_main.cc @@ -12,7 +12,9 @@ // It's intended to set sane defaults, such as removing logging for further // fuzzing efficiency. +#include "api/task_queue/global_task_queue_factory.h" #include "rtc_base/logging.h" +#include "rtc_base/task_queue_stdlib.h" namespace { bool g_initialized = false; @@ -26,6 +28,13 @@ void InitializeWebRtcFuzzDefaults() { rtc::LogMessage::LogToDebug(rtc::LS_NONE); #endif // !defined(WEBRTC_CHROMIUM_BUILD) + // Chromium hijacked DefaultTaskQueueFactory with own implementation, but + // unable to use it without base::test::ScopedTaskEnvironment. Actual used + // task queue implementation shouldn't matter for the purpose of the fuzzers, + // so use stdlib implementation: that one is multiplatform. This is a + // temporary solution until bugs.webrtc.org/10284 is resolved. + webrtc::SetGlobalTaskQueueFactory(webrtc::CreateTaskQueueStdlibFactory()); + g_initialized = true; } } // namespace