summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/api/rtc_event_log
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/api/rtc_event_log')
-rw-r--r--third_party/libwebrtc/api/rtc_event_log/BUILD.gn8
-rw-r--r--third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.cc35
-rw-r--r--third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory.h18
-rw-r--r--third_party/libwebrtc/api/rtc_event_log/rtc_event_log_factory_interface.h8
-rw-r--r--third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build5
5 files changed, 35 insertions, 39 deletions
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 <memory>
-#include <utility>
-#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<RtcEventLog> RtcEventLogFactory::Create(
- RtcEventLog::EncodingType encoding_type) const {
-#ifdef WEBRTC_ENABLE_RTC_EVENT_LOG
- if (field_trial::IsEnabled("WebRTC-RtcEventLogKillSwitch")) {
+absl::Nonnull<std::unique_ptr<RtcEventLog>> RtcEventLogFactory::Create(
+ const Environment& env) const {
+#ifndef WEBRTC_ENABLE_RTC_EVENT_LOG
+ return std::make_unique<RtcEventLogNull>();
+#else
+ if (env.field_trials().IsEnabled("WebRTC-RtcEventLogKillSwitch")) {
return std::make_unique<RtcEventLogNull>();
}
+ RtcEventLog::EncodingType encoding_type =
+ env.field_trials().IsDisabled("WebRTC-RtcEventLogNewFormat")
+ ? RtcEventLog::EncodingType::Legacy
+ : RtcEventLog::EncodingType::NewFormat;
return std::make_unique<RtcEventLogImpl>(
- RtcEventLogImpl::CreateEncoder(encoding_type), task_queue_factory_);
-#else
- return std::make_unique<RtcEventLogNull>();
+ RtcEventLogImpl::CreateEncoder(encoding_type), &env.task_queue_factory());
#endif
}
-std::unique_ptr<RtcEventLog> 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 <memory>
+#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<RtcEventLog> Create(
- RtcEventLog::EncodingType encoding_type) const override;
- std::unique_ptr<RtcEventLog> 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<std::unique_ptr<RtcEventLog>> 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 <memory>
+#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<RtcEventLog> Create(
- RtcEventLog::EncodingType encoding_type) const = 0;
- [[deprecated]] virtual std::unique_ptr<RtcEventLog> CreateRtcEventLog(
- RtcEventLog::EncodingType encoding_type) = 0;
+ virtual absl::Nonnull<std::unique_ptr<RtcEventLog>> 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