mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-18 08:07:56 +01:00
Use stdlib TaskQueue implementation in webrtc fuzzers
Bug: chromium:939093, webrtc:10191 Change-Id: I90463a1b3a003ff575a61cd8f6351927947759f8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126221 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alex Loiko <aleloi@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27030}
This commit is contained in:
parent
3caf50dbb8
commit
f0cbcd39e7
3 changed files with 11 additions and 1 deletions
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue