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