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

Side by Side Diff: ppapi/proxy/ppb_audio_input_proxy.cc

Issue 8749017: Pepper: Add some basic tests for PPB_Audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/ppb_audio_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/ppb_audio_input_proxy.h" 5 #include "ppapi/proxy/ppb_audio_input_proxy.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/threading/simple_thread.h" 8 #include "base/threading/simple_thread.h"
9 #include "ppapi/c/dev/ppb_audio_input_dev.h" 9 #include "ppapi/c/dev/ppb_audio_input_dev.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 PPB_AudioInput_Callback audio_input_callback, 133 PPB_AudioInput_Callback audio_input_callback,
134 void* user_data) { 134 void* user_data) {
135 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); 135 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
136 if (!dispatcher) 136 if (!dispatcher)
137 return 0; 137 return 0;
138 138
139 EnterResourceNoLock<PPB_AudioConfig_API> config(config_id, true); 139 EnterResourceNoLock<PPB_AudioConfig_API> config(config_id, true);
140 if (config.failed()) 140 if (config.failed())
141 return 0; 141 return 0;
142 142
143 if (!audio_input_callback)
144 return 0;
145
143 HostResource result; 146 HostResource result;
144 dispatcher->Send(new PpapiHostMsg_PPBAudioInput_Create( 147 dispatcher->Send(new PpapiHostMsg_PPBAudioInput_Create(
145 API_ID_PPB_AUDIO_INPUT_DEV, instance_id, 148 API_ID_PPB_AUDIO_INPUT_DEV, instance_id,
146 config.object()->GetSampleRate(), config.object()->GetSampleFrameCount(), 149 config.object()->GetSampleRate(), config.object()->GetSampleFrameCount(),
147 &result)); 150 &result));
148 if (result.is_null()) 151 if (result.is_null())
149 return 0; 152 return 0;
150 153
151 return (new AudioInput(result, config_id, audio_input_callback, 154 return (new AudioInput(result, config_id, audio_input_callback,
152 user_data))->GetReference(); 155 user_data))->GetReference();
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( 314 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote(
312 IntToPlatformFile(shared_memory_handle), false); 315 IntToPlatformFile(shared_memory_handle), false);
313 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) 316 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit())
314 return PP_ERROR_FAILED; 317 return PP_ERROR_FAILED;
315 318
316 return PP_OK; 319 return PP_OK;
317 } 320 }
318 321
319 } // namespace proxy 322 } // namespace proxy
320 } // namespace ppapi 323 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/ppb_audio_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698