From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/api/scoped_refptr.h | 33 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'third_party/libwebrtc/api/scoped_refptr.h') diff --git a/third_party/libwebrtc/api/scoped_refptr.h b/third_party/libwebrtc/api/scoped_refptr.h index e145509127..61b2eb1f20 100644 --- a/third_party/libwebrtc/api/scoped_refptr.h +++ b/third_party/libwebrtc/api/scoped_refptr.h @@ -66,7 +66,7 @@ #include #include -namespace rtc { +namespace webrtc { template class scoped_refptr { @@ -162,61 +162,66 @@ class scoped_refptr { }; template -bool operator==(const rtc::scoped_refptr& a, - const rtc::scoped_refptr& b) { +bool operator==(const scoped_refptr& a, const scoped_refptr& b) { return a.get() == b.get(); } template -bool operator!=(const rtc::scoped_refptr& a, - const rtc::scoped_refptr& b) { +bool operator!=(const scoped_refptr& a, const scoped_refptr& b) { return !(a == b); } template -bool operator==(const rtc::scoped_refptr& a, std::nullptr_t) { +bool operator==(const scoped_refptr& a, std::nullptr_t) { return a.get() == nullptr; } template -bool operator!=(const rtc::scoped_refptr& a, std::nullptr_t) { +bool operator!=(const scoped_refptr& a, std::nullptr_t) { return !(a == nullptr); } template -bool operator==(std::nullptr_t, const rtc::scoped_refptr& a) { +bool operator==(std::nullptr_t, const scoped_refptr& a) { return a.get() == nullptr; } template -bool operator!=(std::nullptr_t, const rtc::scoped_refptr& a) { +bool operator!=(std::nullptr_t, const scoped_refptr& a) { return !(a == nullptr); } // Comparison with raw pointer. template -bool operator==(const rtc::scoped_refptr& a, const U* b) { +bool operator==(const scoped_refptr& a, const U* b) { return a.get() == b; } template -bool operator!=(const rtc::scoped_refptr& a, const U* b) { +bool operator!=(const scoped_refptr& a, const U* b) { return !(a == b); } template -bool operator==(const T* a, const rtc::scoped_refptr& b) { +bool operator==(const T* a, const scoped_refptr& b) { return a == b.get(); } template -bool operator!=(const T* a, const rtc::scoped_refptr& b) { +bool operator!=(const T* a, const scoped_refptr& b) { return !(a == b); } // Ordered comparison, needed for use as a std::map key. template -bool operator<(const rtc::scoped_refptr& a, const rtc::scoped_refptr& b) { +bool operator<(const scoped_refptr& a, const scoped_refptr& b) { return a.get() < b.get(); } +} // namespace webrtc + +namespace rtc { +// Backwards compatible alias. +// TODO(bugs.webrtc.org/15622): Deprecate and remove. +template +using scoped_refptr = webrtc::scoped_refptr; } // namespace rtc #endif // API_SCOPED_REFPTR_H_ -- cgit v1.2.3