Fix: RefCountInterface: Make AddRef() and Release() const
The landed CL contained some unwanted changes. TBR=tommi Review URL: https://codereview.webrtc.org/1401743002 . Cr-Commit-Position: refs/heads/master@{#10255}
This commit is contained in:
@ -34,7 +34,6 @@
|
|||||||
#include "talk/app/webrtc/audiotrack.h"
|
#include "talk/app/webrtc/audiotrack.h"
|
||||||
#include "webrtc/base/gunit.h"
|
#include "webrtc/base/gunit.h"
|
||||||
#include "webrtc/base/logging.h"
|
#include "webrtc/base/logging.h"
|
||||||
#include "webrtc/base/refcount.h"
|
|
||||||
#include "webrtc/base/timeutils.h"
|
#include "webrtc/base/timeutils.h"
|
||||||
|
|
||||||
using webrtc::AudioTrackInterface;
|
using webrtc::AudioTrackInterface;
|
||||||
@ -46,7 +45,7 @@ using webrtc::DtmfSenderObserverInterface;
|
|||||||
static const char kTestAudioLabel[] = "test_audio_track";
|
static const char kTestAudioLabel[] = "test_audio_track";
|
||||||
static const int kMaxWaitMs = 3000;
|
static const int kMaxWaitMs = 3000;
|
||||||
|
|
||||||
class FakeDtmfObserver : public DtmfSenderObserverInterface, RefCountInterface {
|
class FakeDtmfObserver : public DtmfSenderObserverInterface {
|
||||||
public:
|
public:
|
||||||
FakeDtmfObserver() : completed_(false) {}
|
FakeDtmfObserver() : completed_(false) {}
|
||||||
|
|
||||||
|
@ -95,11 +95,11 @@ class RefCountedObject : public T {
|
|||||||
: T(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11), ref_count_(0) {
|
: T(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11), ref_count_(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int AddRef() const override {
|
virtual int AddRef() const {
|
||||||
return AtomicOps::Increment(&ref_count_);
|
return AtomicOps::Increment(&ref_count_);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Release() const override {
|
virtual int Release() const {
|
||||||
int count = AtomicOps::Decrement(&ref_count_);
|
int count = AtomicOps::Decrement(&ref_count_);
|
||||||
if (!count) {
|
if (!count) {
|
||||||
delete this;
|
delete this;
|
||||||
|
Reference in New Issue
Block a user