diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/api/scoped_refptr.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/scoped_refptr.h')
-rw-r--r-- | third_party/libwebrtc/api/scoped_refptr.h | 33 |
1 files changed, 19 insertions, 14 deletions
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 <memory> #include <utility> -namespace rtc { +namespace webrtc { template <class T> class scoped_refptr { @@ -162,61 +162,66 @@ class scoped_refptr { }; template <typename T, typename U> -bool operator==(const rtc::scoped_refptr<T>& a, - const rtc::scoped_refptr<U>& b) { +bool operator==(const scoped_refptr<T>& a, const scoped_refptr<U>& b) { return a.get() == b.get(); } template <typename T, typename U> -bool operator!=(const rtc::scoped_refptr<T>& a, - const rtc::scoped_refptr<U>& b) { +bool operator!=(const scoped_refptr<T>& a, const scoped_refptr<U>& b) { return !(a == b); } template <typename T> -bool operator==(const rtc::scoped_refptr<T>& a, std::nullptr_t) { +bool operator==(const scoped_refptr<T>& a, std::nullptr_t) { return a.get() == nullptr; } template <typename T> -bool operator!=(const rtc::scoped_refptr<T>& a, std::nullptr_t) { +bool operator!=(const scoped_refptr<T>& a, std::nullptr_t) { return !(a == nullptr); } template <typename T> -bool operator==(std::nullptr_t, const rtc::scoped_refptr<T>& a) { +bool operator==(std::nullptr_t, const scoped_refptr<T>& a) { return a.get() == nullptr; } template <typename T> -bool operator!=(std::nullptr_t, const rtc::scoped_refptr<T>& a) { +bool operator!=(std::nullptr_t, const scoped_refptr<T>& a) { return !(a == nullptr); } // Comparison with raw pointer. template <typename T, typename U> -bool operator==(const rtc::scoped_refptr<T>& a, const U* b) { +bool operator==(const scoped_refptr<T>& a, const U* b) { return a.get() == b; } template <typename T, typename U> -bool operator!=(const rtc::scoped_refptr<T>& a, const U* b) { +bool operator!=(const scoped_refptr<T>& a, const U* b) { return !(a == b); } template <typename T, typename U> -bool operator==(const T* a, const rtc::scoped_refptr<U>& b) { +bool operator==(const T* a, const scoped_refptr<U>& b) { return a == b.get(); } template <typename T, typename U> -bool operator!=(const T* a, const rtc::scoped_refptr<U>& b) { +bool operator!=(const T* a, const scoped_refptr<U>& b) { return !(a == b); } // Ordered comparison, needed for use as a std::map key. template <typename T, typename U> -bool operator<(const rtc::scoped_refptr<T>& a, const rtc::scoped_refptr<U>& b) { +bool operator<(const scoped_refptr<T>& a, const scoped_refptr<U>& b) { return a.get() < b.get(); } +} // namespace webrtc + +namespace rtc { +// Backwards compatible alias. +// TODO(bugs.webrtc.org/15622): Deprecate and remove. +template <typename T> +using scoped_refptr = webrtc::scoped_refptr<T>; } // namespace rtc #endif // API_SCOPED_REFPTR_H_ |