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

Unified Diff: webrtc/modules/video_capture/video_capture_impl.cc

Issue 1477013005: Replace RefCountImpl with rtc::RefCountedObject. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add back explicit Release()s in test Created 4 years, 9 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/video_capture/video_capture_impl.cc
diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc
index 81f6311e650659a5835dffef472ed355522ba3c7..4ab8ff18ac008dbcfe4f7af08c89d351e3faf69f 100644
--- a/webrtc/modules/video_capture/video_capture_impl.cc
+++ b/webrtc/modules/video_capture/video_capture_impl.cc
@@ -12,6 +12,7 @@
#include <stdlib.h>
+#include "webrtc/base/refcount.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/include/module_common_types.h"
@@ -19,22 +20,17 @@
#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/logging.h"
-#include "webrtc/system_wrappers/include/ref_count.h"
#include "webrtc/system_wrappers/include/tick_util.h"
-namespace webrtc
-{
-
-namespace videocapturemodule
-{
-VideoCaptureModule* VideoCaptureImpl::Create(
+namespace webrtc {
+namespace videocapturemodule {
+rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
const int32_t id,
- VideoCaptureExternal*& externalCapture)
-{
- RefCountImpl<VideoCaptureImpl>* implementation =
- new RefCountImpl<VideoCaptureImpl>(id);
- externalCapture = implementation;
- return implementation;
+ VideoCaptureExternal*& externalCapture) {
+ rtc::scoped_refptr<VideoCaptureImpl> implementation(
+ new rtc::RefCountedObject<VideoCaptureImpl>(id));
+ externalCapture = implementation.get();
+ return implementation;
}
const char* VideoCaptureImpl::CurrentDeviceName() const
« no previous file with comments | « webrtc/modules/video_capture/video_capture_impl.h ('k') | webrtc/modules/video_capture/windows/device_info_ds.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698