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

Unified Diff: ppapi/proxy/ppb_audio_config_proxy.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « ppapi/proxy/ppb_audio_config_proxy.h ('k') | ppapi/proxy/ppb_audio_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_audio_config_proxy.cc
===================================================================
--- ppapi/proxy/ppb_audio_config_proxy.cc (revision 72840)
+++ 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.
@@ -14,10 +14,10 @@
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 @@
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 @@
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(
« no previous file with comments | « ppapi/proxy/ppb_audio_config_proxy.h ('k') | ppapi/proxy/ppb_audio_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698