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

Unified Diff: webrtc/modules/audio_device/audio_device_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
« no previous file with comments | « webrtc/modules/audio_device/audio_device_impl.h ('k') | webrtc/modules/audio_device/include/audio_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/audio_device_impl.cc
diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc
index 6496f5efc43d800ee0f4da37e2c909a05000e9ab..d881bcd40c9293358b6ac8f1b5a21c3e8cc78982 100644
--- a/webrtc/modules/audio_device/audio_device_impl.cc
+++ b/webrtc/modules/audio_device/audio_device_impl.cc
@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/base/refcount.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/audio_device/audio_device_config.h"
#include "webrtc/modules/audio_device/audio_device_impl.h"
-#include "webrtc/system_wrappers/include/ref_count.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include <assert.h>
@@ -65,13 +65,7 @@
}; \
}
-namespace webrtc
-{
-
-AudioDeviceModule* CreateAudioDeviceModule(
- int32_t id, AudioDeviceModule::AudioLayer audioLayer) {
- return AudioDeviceModuleImpl::Create(id, audioLayer);
-}
+namespace webrtc {
// ============================================================================
// Static methods
@@ -81,33 +75,30 @@ AudioDeviceModule* CreateAudioDeviceModule(
// AudioDeviceModule::Create()
// ----------------------------------------------------------------------------
-AudioDeviceModule* AudioDeviceModuleImpl::Create(const int32_t id,
- const AudioLayer audioLayer)
-{
+rtc::scoped_refptr<AudioDeviceModule> AudioDeviceModuleImpl::Create(
+ const int32_t id,
+ const AudioLayer audioLayer) {
// Create the generic ref counted (platform independent) implementation.
- RefCountImpl<AudioDeviceModuleImpl>* audioDevice =
- new RefCountImpl<AudioDeviceModuleImpl>(id, audioLayer);
+ rtc::scoped_refptr<AudioDeviceModuleImpl> audioDevice(
+ new rtc::RefCountedObject<AudioDeviceModuleImpl>(id, audioLayer));
// Ensure that the current platform is supported.
if (audioDevice->CheckPlatform() == -1)
{
- delete audioDevice;
- return NULL;
+ return nullptr;
}
// Create the platform-dependent implementation.
if (audioDevice->CreatePlatformSpecificObjects() == -1)
{
- delete audioDevice;
- return NULL;
+ return nullptr;
}
// Ensure that the generic audio buffer can communicate with the
// platform-specific parts.
if (audioDevice->AttachAudioBuffer() == -1)
{
- delete audioDevice;
- return NULL;
+ return nullptr;
}
WebRtcSpl_Init();
« no previous file with comments | « webrtc/modules/audio_device/audio_device_impl.h ('k') | webrtc/modules/audio_device/include/audio_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698