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:
Magnus Jedvert
2015-10-12 16:10:43 +02:00
parent 52a30e31f1
commit fc950848e3
2 changed files with 3 additions and 4 deletions

View File

@ -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) {}

View File

@ -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;