Bump to WebRTC M120 release
Some API deprecation -- ExperimentalAgc and ExperimentalNs are gone. We're continuing to carry iSAC even though it's gone upstream, but maybe we'll want to drop that soon.
This commit is contained in:
@ -10,10 +10,7 @@
|
||||
#ifndef RTC_BASE_REF_COUNTED_OBJECT_H_
|
||||
#define RTC_BASE_REF_COUNTED_OBJECT_H_
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "rtc_base/ref_count.h"
|
||||
#include "rtc_base/ref_counter.h"
|
||||
|
||||
@ -24,6 +21,9 @@ class RefCountedObject : public T {
|
||||
public:
|
||||
RefCountedObject() {}
|
||||
|
||||
RefCountedObject(const RefCountedObject&) = delete;
|
||||
RefCountedObject& operator=(const RefCountedObject&) = delete;
|
||||
|
||||
template <class P0>
|
||||
explicit RefCountedObject(P0&& p0) : T(std::forward<P0>(p0)) {}
|
||||
|
||||
@ -33,9 +33,9 @@ class RefCountedObject : public T {
|
||||
std::forward<P1>(p1),
|
||||
std::forward<Args>(args)...) {}
|
||||
|
||||
virtual void AddRef() const { ref_count_.IncRef(); }
|
||||
void AddRef() const override { ref_count_.IncRef(); }
|
||||
|
||||
virtual RefCountReleaseStatus Release() const {
|
||||
RefCountReleaseStatus Release() const override {
|
||||
const auto status = ref_count_.DecRef();
|
||||
if (status == RefCountReleaseStatus::kDroppedLastRef) {
|
||||
delete this;
|
||||
@ -52,11 +52,36 @@ class RefCountedObject : public T {
|
||||
virtual bool HasOneRef() const { return ref_count_.HasOneRef(); }
|
||||
|
||||
protected:
|
||||
virtual ~RefCountedObject() {}
|
||||
~RefCountedObject() override {}
|
||||
|
||||
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
|
||||
};
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RefCountedObject);
|
||||
template <class T>
|
||||
class FinalRefCountedObject final : public T {
|
||||
public:
|
||||
using T::T;
|
||||
// Above using declaration propagates a default move constructor
|
||||
// FinalRefCountedObject(FinalRefCountedObject&& other), but we also need
|
||||
// move construction from T.
|
||||
explicit FinalRefCountedObject(T&& other) : T(std::move(other)) {}
|
||||
FinalRefCountedObject(const FinalRefCountedObject&) = delete;
|
||||
FinalRefCountedObject& operator=(const FinalRefCountedObject&) = delete;
|
||||
|
||||
void AddRef() const { ref_count_.IncRef(); }
|
||||
RefCountReleaseStatus Release() const {
|
||||
const auto status = ref_count_.DecRef();
|
||||
if (status == RefCountReleaseStatus::kDroppedLastRef) {
|
||||
delete this;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
bool HasOneRef() const { return ref_count_.HasOneRef(); }
|
||||
|
||||
private:
|
||||
~FinalRefCountedObject() = default;
|
||||
|
||||
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
Reference in New Issue
Block a user