diff options
Diffstat (limited to 'ppapi/proxy/ppb_audio_config_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_audio_config_proxy.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ppapi/proxy/ppb_audio_config_proxy.cc b/ppapi/proxy/ppb_audio_config_proxy.cc index 8bf62c3..d437694 100644 --- a/ppapi/proxy/ppb_audio_config_proxy.cc +++ b/ppapi/proxy/ppb_audio_config_proxy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,10 +14,10 @@ namespace proxy { class AudioConfig : public PluginResource { public: - AudioConfig(PP_Instance instance, + AudioConfig(const HostResource& resource, PP_AudioSampleRate sample_rate, uint32_t sample_frame_count) - : PluginResource(instance), + : PluginResource(resource), sample_rate_(sample_rate), sample_frame_count_(sample_frame_count) { } @@ -41,19 +41,18 @@ namespace { PP_Resource CreateStereo16bit(PP_Instance instance, PP_AudioSampleRate sample_rate, uint32_t sample_frame_count) { - PP_Resource result = 0; + HostResource resource; PluginDispatcher::GetForInstance(instance)->Send( new PpapiHostMsg_PPBAudioConfig_Create( INTERFACE_ID_PPB_AUDIO_CONFIG, instance, static_cast<int32_t>(sample_rate), sample_frame_count, - &result)); - if (!result) + &resource)); + if (!resource.is_null()) return 0; linked_ptr<AudioConfig> object( - new AudioConfig(instance, sample_rate, sample_frame_count)); - PluginResourceTracker::GetInstance()->AddResource(result, object); - return result; + new AudioConfig(resource, sample_rate, sample_frame_count)); + return PluginResourceTracker::GetInstance()->AddResource(object); } uint32_t RecommendSampleFrameCount(PP_AudioSampleRate sample_rate, @@ -129,10 +128,11 @@ bool PPB_AudioConfig_Proxy::OnMessageReceived(const IPC::Message& msg) { void PPB_AudioConfig_Proxy::OnMsgCreateStereo16Bit(PP_Instance instance, int32_t sample_rate, uint32_t sample_frame_count, - PP_Resource* result) { - *result = ppb_audio_config_target()->CreateStereo16Bit( - instance, static_cast<PP_AudioSampleRate>(sample_rate), - sample_frame_count); + HostResource* result) { + result->SetHostResource(instance, + ppb_audio_config_target()->CreateStereo16Bit( + instance, static_cast<PP_AudioSampleRate>(sample_rate), + sample_frame_count)); } void PPB_AudioConfig_Proxy::OnMsgRecommendSampleFrameCount( |