Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: webrtc/system_wrappers/interface/ref_count.h

Issue 1347793005: Replace Atomic32 with webrtc/base/atomicops.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix typo Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/system_wrappers/interface/ref_count.h
diff --git a/webrtc/system_wrappers/interface/ref_count.h b/webrtc/system_wrappers/interface/ref_count.h
index 68616662e906a1c96095e5d401047bbfb84bd317..7ff963dd1abf06d1b4cee1c37cc8421e3c39e2b6 100644
--- a/webrtc/system_wrappers/interface/ref_count.h
+++ b/webrtc/system_wrappers/interface/ref_count.h
@@ -11,7 +11,7 @@
#ifndef SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_
#define SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_
-#include "webrtc/system_wrappers/interface/atomic32.h"
+#include "webrtc/base/atomicops.h"
namespace webrtc {
@@ -61,20 +61,18 @@ class RefCountImpl : public T {
RefCountImpl(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
: T(p1, p2, p3, p4, p5), ref_count_(0) {}
- virtual int32_t AddRef() {
- return ++ref_count_;
- }
+ virtual int32_t AddRef() { return rtc::AtomicOps::Increment(&ref_count_); }
virtual int32_t Release() {
int32_t ref_count;
- ref_count = --ref_count_;
+ ref_count = rtc::AtomicOps::Decrement(&ref_count_);
if (ref_count == 0)
delete this;
return ref_count;
}
protected:
- Atomic32 ref_count_;
+ volatile int ref_count_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698