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

Unified Diff: webrtc/video_engine/payload_router.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/video_engine/payload_router.h
diff --git a/webrtc/video_engine/payload_router.h b/webrtc/video_engine/payload_router.h
index 0d6a1ac6dde48709aa8aaf2df37c7b11b64135bc..6909833cdb3ff1a38b73e3b4351f90cb5062207a 100644
--- a/webrtc/video_engine/payload_router.h
+++ b/webrtc/video_engine/payload_router.h
@@ -14,11 +14,11 @@
#include <list>
#include <vector>
+#include "webrtc/base/atomicops.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/common_types.h"
-#include "webrtc/system_wrappers/interface/atomic32.h"
namespace webrtc {
@@ -63,8 +63,12 @@ class PayloadRouter {
// and RTP headers.
size_t MaxPayloadLength() const;
- void AddRef() { ++ref_count_; }
- void Release() { if (--ref_count_ == 0) { delete this; } }
+ void AddRef() { rtc::AtomicOps::Increment(&ref_count_); }
+ void Release() {
+ if (rtc::AtomicOps::Decrement(&ref_count_) == 0) {
+ delete this;
+ }
+ }
private:
// TODO(mflodman): When the new video API has launched, remove crit_ and
@@ -75,7 +79,7 @@ class PayloadRouter {
std::vector<RtpRtcp*> rtp_modules_ GUARDED_BY(crit_.get());
bool active_ GUARDED_BY(crit_.get());
- Atomic32 ref_count_;
+ volatile int ref_count_;
RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter);
};

Powered by Google App Engine
This is Rietveld 408576698