commit 245e5e96ecbc4e9f143312032760456cbf09cfb3
parent 2143ccd5b533b73e2975128e22528780bbe75521
Author: Dan Baker <dbaker@mozilla.com>
Date: Mon, 1 Dec 2025 23:07:50 -0700
Bug 2000941 - Vendor libwebrtc from d702862c01
Upstream commit: https://webrtc.googlesource.com/src/+/d702862c018c29cce4dad67832539129a9c20b1b
Make the debug only get_value_called atomic in FieldTrials
To allow concurrent access from multiple threads, see attached bug.
Bug: b/446639918
Change-Id: I847c2c6e168872833104d0feb944ee9d82eca030
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/411500
Auto-Submit: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45707}
Diffstat:
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T06:05:19.467083+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T06:07:36.799314+00:00.
# base of lastest vendoring
-d4a6a2db50
+d702862c01
diff --git a/third_party/libwebrtc/api/field_trials.cc b/third_party/libwebrtc/api/field_trials.cc
@@ -74,6 +74,10 @@ FieldTrials::FieldTrials(const FieldTrials& other)
key_value_map_ = other.key_value_map_;
}
+FieldTrials::FieldTrials(FieldTrials&& other) : FieldTrialsRegistry(other) {
+ key_value_map_ = std::move(other.key_value_map_);
+}
+
FieldTrials& FieldTrials::operator=(const FieldTrials& other) {
if (this != &other) {
AssertGetValueNotCalled();
diff --git a/third_party/libwebrtc/api/field_trials.h b/third_party/libwebrtc/api/field_trials.h
@@ -11,6 +11,7 @@
#ifndef API_FIELD_TRIALS_H_
#define API_FIELD_TRIALS_H_
+#include <atomic>
#include <memory>
#include <string>
#include <utility>
@@ -52,7 +53,7 @@ class FieldTrials : public FieldTrialsRegistry {
explicit FieldTrials(absl::string_view s);
FieldTrials(const FieldTrials&);
- FieldTrials(FieldTrials&&) = default;
+ FieldTrials(FieldTrials&&);
FieldTrials& operator=(const FieldTrials&);
FieldTrials& operator=(FieldTrials&&);
@@ -97,7 +98,7 @@ class FieldTrials : public FieldTrialsRegistry {
// This is used to enforce immutability by DCHECK:ing
// that modification are performed once get_value_called_
// is true.
- mutable bool get_value_called_ = false;
+ mutable std::atomic<bool> get_value_called_ = false;
#endif
flat_map<std::string, std::string> key_value_map_;