Index: webkit/plugins/ppapi/ppb_audio_input_impl.cc |
diff --git a/webkit/plugins/ppapi/ppb_audio_input_impl.cc b/webkit/plugins/ppapi/ppb_audio_input_impl.cc |
index fe1036d9187283a21caa07b1da11dea4ec6e58e4..416282125ca1e7dc573499b48df380ca9a05070b 100644 |
--- a/webkit/plugins/ppapi/ppb_audio_input_impl.cc |
+++ b/webkit/plugins/ppapi/ppb_audio_input_impl.cc |
@@ -16,6 +16,7 @@ |
#include "webkit/plugins/ppapi/common.h" |
#include "webkit/plugins/ppapi/resource_helper.h" |
+using ppapi::ApiCallbackType; |
using ppapi::TrackedCallback; |
namespace webkit { |
@@ -42,7 +43,7 @@ PP_Resource PPB_AudioInput_Impl::Create0_1( |
audio_input(new PPB_AudioInput_Impl(instance)); |
int32_t result = audio_input->Open( |
"", config, audio_input_callback, user_data, |
- MakeIgnoredCompletionCallback()); |
+ MakeIgnoredCompletionCallback(audio_input.get())); |
if (result != PP_OK && result != PP_OK_COMPLETIONPENDING) |
return 0; |
return audio_input->GetReference(); |
@@ -51,7 +52,7 @@ PP_Resource PPB_AudioInput_Impl::Create0_1( |
int32_t PPB_AudioInput_Impl::OpenTrusted( |
const std::string& device_id, |
PP_Resource config, |
- const PP_CompletionCallback& create_callback) { |
+ ApiCallbackType create_callback) { |
return CommonOpen(device_id, config, NULL, NULL, create_callback); |
} |
@@ -104,13 +105,13 @@ void PPB_AudioInput_Impl::StreamCreationFailed() { |
int32_t PPB_AudioInput_Impl::InternalEnumerateDevices( |
PP_Resource* devices, |
- PP_CompletionCallback callback) { |
+ ApiCallbackType callback) { |
PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
if (!plugin_delegate) |
return PP_ERROR_FAILED; |
devices_ = devices; |
- enumerate_devices_callback_ = new TrackedCallback(this, callback); |
+ enumerate_devices_callback_ = callback; |
plugin_delegate->EnumerateDevices( |
PP_DEVICETYPE_DEV_AUDIOCAPTURE, |
base::Bind(&PPB_AudioInput_Impl::EnumerateDevicesCallbackFunc, |
@@ -121,7 +122,7 @@ int32_t PPB_AudioInput_Impl::InternalEnumerateDevices( |
int32_t PPB_AudioInput_Impl::InternalOpen(const std::string& device_id, |
PP_AudioSampleRate sample_rate, |
uint32_t sample_frame_count, |
- PP_CompletionCallback callback) { |
+ ApiCallbackType callback) { |
PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
if (!plugin_delegate) |
return PP_ERROR_FAILED; |
@@ -131,7 +132,7 @@ int32_t PPB_AudioInput_Impl::InternalOpen(const std::string& device_id, |
audio_input_ = plugin_delegate->CreateAudioInput( |
device_id, sample_rate, sample_frame_count, this); |
if (audio_input_) { |
- open_callback_ = new TrackedCallback(this, callback); |
+ open_callback_ = callback; |
return PP_OK_COMPLETIONPENDING; |
} else { |
return PP_ERROR_FAILED; |