Files
Michael Froman 5b11b5bd6a Bug 2064200 - Vendor libwebrtc from 93173ec4f5
Upstream commit: https://webrtc.googlesource.com/src/+/93173ec4f5fdf71a9249e56e87707ccae750ad52
    Restrict rtc_event_log.proto to offline tools + add documentation

    1. Remove the legacy rtc_event_log_proto dependency from the production
       libwebrtc static library GN target in root BUILD.gn.
    2. Restrict proto_library("rtc_event_log_proto") visibility in logging/BUILD.gn
       exclusively to offline parsers, neteq tools, and test suites to prevent
       accidental linking into production runtimes.
    3. Add a deprecation banner and usage instruction to rtc_event_log.proto,
       update doc comments in rtc_event_log.h, and add a dedicated section in
       logging/g3doc/rtc_event_log.md guiding humans and AI agents on format rules.

    CONV=ac69de71-4eeb-4b00-b142-f66d9edf397b

    Bug: webrtc:144833892
    Change-Id: I91f19d1f9664ecf17e38e0fa44a46b854361d6bd
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/493540
    Reviewed-by: Björn Terelius <terelius@webrtc.org>
    Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#48287}
2026-08-28 09:30:55 +00:00

75 lines
2.8 KiB
Diff

From: Dan Baker <dbaker@mozilla.com>
Date: Thu, 14 Mar 2024 10:51:00 -0600
Subject: Bug 1883116 - (fix-e79e722834) add enviroment_factory to libwebrtc
build and enforce providing clock and task_queue when creating Environment
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2185cab977988fd4ab03b38dc67f9b06162444da
---
BUILD.gn | 1 +
api/environment/environment_factory.cc | 10 ++++++++++
api/task_queue/BUILD.gn | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/BUILD.gn b/BUILD.gn
index ae43bfa74e..ad83200fa5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -629,6 +629,7 @@ if (!build_with_chromium) {
"api/audio:builtin_audio_processing_builder",
"api/video:adapted_video_track_source",
"api/video:builtin_video_bitrate_allocator_factory",
+ "api/environment:environment_factory",
"api/video:video_frame",
"api/video:video_rtp_headers",
"test:rtp_test_utils",
diff --git a/api/environment/environment_factory.cc b/api/environment/environment_factory.cc
index 53773dc79f..72a0fdbbd3 100644
--- a/api/environment/environment_factory.cc
+++ b/api/environment/environment_factory.cc
@@ -108,12 +108,22 @@ Environment EnvironmentFactory::CreateWithDefaults() && {
if (field_trials_ == nullptr) {
Set(std::make_unique<DeprecatedGlobalFieldTrials>());
}
+#if defined(WEBRTC_MOZILLA_BUILD)
+ // We want to use our clock, not GetRealTimeClockRaw, and we avoid
+ // building the code under third_party/libwebrtc/task_queue. To
+ // ensure we're setting up things correctly, namely providing an
+ // Environment object with a preset task_queue_factory and clock,
+ // we'll do a release assert here.
+ RTC_CHECK(clock_);
+ RTC_CHECK(task_queue_factory_);
+#else
if (clock_ == nullptr) {
Set(Clock::GetRealTimeClock());
}
if (task_queue_factory_ == nullptr) {
Set(CreateDefaultTaskQueueFactory(field_trials_));
}
+#endif
if (event_log_ == nullptr) {
Set(std::make_unique<RtcEventLogNull>());
}
diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn
index dc14e40d7a..48d6e66435 100644
--- a/api/task_queue/BUILD.gn
+++ b/api/task_queue/BUILD.gn
@@ -83,6 +83,10 @@ rtc_library("task_queue_test") {
}
rtc_library("default_task_queue_factory") {
+# Mozilla - disable this entire target to avoid inclusion of code we want
+# to avoid. Better here than trying to wack-a-mole for places that list
+# it as a dependency.
+if (!build_with_mozilla) {
visibility = [ "*" ]
# Internally webrtc shouldn't rely on any specific TaskQueue implementation
@@ -106,6 +110,7 @@ rtc_library("default_task_queue_factory") {
sources += [ "default_task_queue_factory_stdlib.cc" ]
deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
}
+} # of if (!build_with_mozilla) {
}
rtc_library("pending_task_safety_flag") {