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

Unified Diff: webrtc/modules/desktop_capture/x11/shared_x_display.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/modules/desktop_capture/x11/shared_x_display.h
diff --git a/webrtc/modules/desktop_capture/x11/shared_x_display.h b/webrtc/modules/desktop_capture/x11/shared_x_display.h
index 02755450fc28e019e4ab5a94f580513abbbf55d2..91ba92b8bf64e503b7d3f8e9dd02266c226ca198 100644
--- a/webrtc/modules/desktop_capture/x11/shared_x_display.h
+++ b/webrtc/modules/desktop_capture/x11/shared_x_display.h
@@ -19,8 +19,9 @@
#include <string>
+#include "webrtc/base/atomicops.h"
+#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ref_ptr.h"
-#include "webrtc/system_wrappers/interface/atomic32.h"
namespace webrtc {
@@ -48,9 +49,9 @@ class SharedXDisplay {
// DISPLAY). NULL is returned if X11 connection failed.
static rtc::scoped_refptr<SharedXDisplay> CreateDefault();
- void AddRef() { ++ref_count_; }
+ void AddRef() { rtc::AtomicOps::Increment(&ref_count_); }
void Release() {
- if (--ref_count_ == 0)
+ if (rtc::AtomicOps::Decrement(&ref_count_) == 0)
delete this;
}
@@ -71,7 +72,7 @@ class SharedXDisplay {
~SharedXDisplay();
- Atomic32 ref_count_;
+ volatile int ref_count_;
Display* display_;
EventHandlersMap event_handlers_;

Powered by Google App Engine
This is Rietveld 408576698