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

Unified Diff: webrtc/modules/video_capture/windows/video_capture_factory_windows.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
« no previous file with comments | « webrtc/modules/video_capture/windows/device_info_ds.cc ('k') | webrtc/system_wrappers/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
diff --git a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
index 747d3d60cfc719e0d44807574fbad1e44cce0ea9..0d347cb64f428e43d0952ca9e06a9b2753bac28a 100644
--- a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
+++ b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
@@ -8,9 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/base/refcount.h"
+#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/modules/video_capture/windows/video_capture_ds.h"
#include "webrtc/modules/video_capture/windows/video_capture_mf.h"
-#include "webrtc/system_wrappers/include/ref_count.h"
namespace webrtc {
namespace videocapturemodule {
@@ -22,16 +23,17 @@ VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
return DeviceInfoDS::Create(id);
}
-VideoCaptureModule* VideoCaptureImpl::Create(const int32_t id,
- const char* device_id) {
- if (device_id == NULL)
- return NULL;
+rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
+ const int32_t id,
+ const char* device_id) {
+ if (device_id == nullptr)
+ return nullptr;
// TODO(tommi): Use Media Foundation implementation for Vista and up.
- RefCountImpl<VideoCaptureDS>* capture = new RefCountImpl<VideoCaptureDS>(id);
+ rtc::scoped_refptr<VideoCaptureDS> capture(
+ new rtc::RefCountedObject<VideoCaptureDS>(id));
if (capture->Init(id, device_id) != 0) {
- delete capture;
- capture = NULL;
+ return nullptr;
}
return capture;
« no previous file with comments | « webrtc/modules/video_capture/windows/device_info_ds.cc ('k') | webrtc/system_wrappers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698