Index: ppapi/proxy/ppb_audio_config_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_audio_config_proxy.cc (revision 72517) |
+++ ppapi/proxy/ppb_audio_config_proxy.cc (working copy) |
@@ -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. |
@@ -15,9 +15,10 @@ |
class AudioConfig : public PluginResource { |
public: |
AudioConfig(PP_Instance instance, |
+ SerializedResource resource, |
PP_AudioSampleRate sample_rate, |
uint32_t sample_frame_count) |
- : PluginResource(instance), |
+ : PluginResource(instance, resource), |
sample_rate_(sample_rate), |
sample_frame_count_(sample_frame_count) { |
} |
@@ -41,19 +42,18 @@ |
PP_Resource CreateStereo16bit(PP_Instance instance, |
PP_AudioSampleRate sample_rate, |
uint32_t sample_frame_count) { |
- PP_Resource result = 0; |
+ SerializedResource 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(instance, resource, sample_rate, sample_frame_count)); |
+ return PluginResourceTracker::GetInstance()->AddResource(object); |
} |
uint32_t RecommendSampleFrameCount(PP_AudioSampleRate sample_rate, |
@@ -129,10 +129,10 @@ |
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( |
+ SerializedResource* result) { |
+ result->set_host_resource(ppb_audio_config_target()->CreateStereo16Bit( |
instance, static_cast<PP_AudioSampleRate>(sample_rate), |
- sample_frame_count); |
+ sample_frame_count)); |
} |
void PPB_AudioConfig_Proxy::OnMsgRecommendSampleFrameCount( |