From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/api/rtc_event_log/BUILD.gn | 8 +++-- .../api/rtc_event_log/rtc_event_log_factory.cc | 35 ++++++++++------------ .../api/rtc_event_log/rtc_event_log_factory.h | 18 ++++++----- .../rtc_event_log_factory_interface.h | 8 ++--- .../api/rtc_event_log/rtc_event_log_gn/moz.build | 5 ---- 5 files changed, 35 insertions(+), 39 deletions(-) (limited to 'third_party/libwebrtc/api/rtc_event_log') diff --git a/third_party/libwebrtc/api/rtc_event_log/BUILD.gn b/third_party/libwebrtc/api/rtc_event_log/BUILD.gn index 158dc06a7b..073c91a5e8 100644 --- a/third_party/libwebrtc/api/rtc_event_log/BUILD.gn +++ b/third_party/libwebrtc/api/rtc_event_log/BUILD.gn @@ -22,8 +22,10 @@ rtc_library("rtc_event_log") { "..:libjingle_logging_api", "../../rtc_base:checks", "../../rtc_base:timeutils", + "../environment", "../task_queue", ] + absl_deps = [ "//third_party/abseil-cpp/absl/base:nullability" ] } rtc_library("rtc_event_log_factory") { @@ -35,12 +37,14 @@ rtc_library("rtc_event_log_factory") { deps = [ ":rtc_event_log", - "../../rtc_base:checks", + "..:field_trials_view", "../../rtc_base/system:rtc_export", - "../../system_wrappers:field_trial", + "../environment", "../task_queue", ] + absl_deps = [ "//third_party/abseil-cpp/absl/base:nullability" ] + if (rtc_enable_protobuf) { defines = [ "WEBRTC_ENABLE_RTC_EVENT_LOG" ] deps += [ "../../logging:rtc_event_log_impl" ] diff --git a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.cc b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.cc index a3cb68cf54..30fc6f126f 100644 --- a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.cc +++ b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.cc @@ -11,10 +11,11 @@ #include "api/rtc_event_log/rtc_event_log_factory.h" #include -#include -#include "rtc_base/checks.h" -#include "system_wrappers/include/field_trial.h" +#include "absl/base/nullability.h" +#include "api/environment/environment.h" +#include "api/field_trials_view.h" +#include "api/rtc_event_log/rtc_event_log.h" #ifdef WEBRTC_ENABLE_RTC_EVENT_LOG #include "logging/rtc_event_log/rtc_event_log_impl.h" @@ -22,27 +23,21 @@ namespace webrtc { -RtcEventLogFactory::RtcEventLogFactory(TaskQueueFactory* task_queue_factory) - : task_queue_factory_(task_queue_factory) { - RTC_DCHECK(task_queue_factory_); -} - -std::unique_ptr RtcEventLogFactory::Create( - RtcEventLog::EncodingType encoding_type) const { -#ifdef WEBRTC_ENABLE_RTC_EVENT_LOG - if (field_trial::IsEnabled("WebRTC-RtcEventLogKillSwitch")) { +absl::Nonnull> RtcEventLogFactory::Create( + const Environment& env) const { +#ifndef WEBRTC_ENABLE_RTC_EVENT_LOG + return std::make_unique(); +#else + if (env.field_trials().IsEnabled("WebRTC-RtcEventLogKillSwitch")) { return std::make_unique(); } + RtcEventLog::EncodingType encoding_type = + env.field_trials().IsDisabled("WebRTC-RtcEventLogNewFormat") + ? RtcEventLog::EncodingType::Legacy + : RtcEventLog::EncodingType::NewFormat; return std::make_unique( - RtcEventLogImpl::CreateEncoder(encoding_type), task_queue_factory_); -#else - return std::make_unique(); + RtcEventLogImpl::CreateEncoder(encoding_type), &env.task_queue_factory()); #endif } -std::unique_ptr RtcEventLogFactory::CreateRtcEventLog( - RtcEventLog::EncodingType encoding_type) { - return Create(encoding_type); -} - } // namespace webrtc diff --git a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.h b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.h index fd1db3c728..21a670e1a7 100644 --- a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.h +++ b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.h @@ -13,6 +13,8 @@ #include +#include "absl/base/nullability.h" +#include "api/environment/environment.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h" #include "api/task_queue/task_queue_factory.h" @@ -22,16 +24,16 @@ namespace webrtc { class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface { public: - explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory); - ~RtcEventLogFactory() override {} + RtcEventLogFactory() = default; - std::unique_ptr Create( - RtcEventLog::EncodingType encoding_type) const override; - std::unique_ptr CreateRtcEventLog( - RtcEventLog::EncodingType encoding_type) override; + // TODO(bugs.webrtc.org/15656): deprecate and delete constructor taking + // task queue factory in favor of using task queue factory provided through + // the Environment parameter in Create function. + explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory) {} + ~RtcEventLogFactory() override = default; - private: - TaskQueueFactory* const task_queue_factory_; + absl::Nonnull> Create( + const Environment& env) const override; }; } // namespace webrtc diff --git a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory_interface.h b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory_interface.h index a6f4dee92f..3135584966 100644 --- a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory_interface.h +++ b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory_interface.h @@ -13,6 +13,8 @@ #include +#include "absl/base/nullability.h" +#include "api/environment/environment.h" #include "api/rtc_event_log/rtc_event_log.h" namespace webrtc { @@ -24,10 +26,8 @@ class RtcEventLogFactoryInterface { public: virtual ~RtcEventLogFactoryInterface() = default; - virtual std::unique_ptr Create( - RtcEventLog::EncodingType encoding_type) const = 0; - [[deprecated]] virtual std::unique_ptr CreateRtcEventLog( - RtcEventLog::EncodingType encoding_type) = 0; + virtual absl::Nonnull> Create( + const Environment& env) const = 0; }; } // namespace webrtc diff --git a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build index 1965bc7a12..991c0366b6 100644 --- a/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build +++ b/third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build @@ -196,7 +196,6 @@ if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "arm": OS_LIBS += [ - "android_support", "unwind" ] @@ -206,10 +205,6 @@ if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86": "-msse2" ] - OS_LIBS += [ - "android_support" - ] - if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64": DEFINES["_GNU_SOURCE"] = True -- cgit v1.2.3