OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_proxy.h" | 5 #include "ppapi/proxy/ppb_audio_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/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_audio.h" | 10 #include "ppapi/c/ppb_audio.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 OnMsgNotifyAudioStreamCreated) | 164 OnMsgNotifyAudioStreamCreated) |
165 IPC_MESSAGE_UNHANDLED(handled = false) | 165 IPC_MESSAGE_UNHANDLED(handled = false) |
166 IPC_END_MESSAGE_MAP() | 166 IPC_END_MESSAGE_MAP() |
167 return handled; | 167 return handled; |
168 } | 168 } |
169 | 169 |
170 void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id, | 170 void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id, |
171 int32_t sample_rate, | 171 int32_t sample_rate, |
172 uint32_t sample_frame_count, | 172 uint32_t sample_frame_count, |
173 HostResource* result) { | 173 HostResource* result) { |
174 thunk::EnterFunction<thunk::ResourceCreationAPI> resource_creation( | 174 thunk::EnterResourceCreation resource_creation(instance_id); |
175 instance_id, true); | |
176 if (resource_creation.failed()) | 175 if (resource_creation.failed()) |
177 return; | 176 return; |
178 | 177 |
179 // Make the resource and get the API pointer to its trusted interface. | 178 // Make the resource and get the API pointer to its trusted interface. |
180 result->SetHostResource( | 179 result->SetHostResource( |
181 instance_id, | 180 instance_id, |
182 resource_creation.functions()->CreateAudioTrusted(instance_id)); | 181 resource_creation.functions()->CreateAudioTrusted(instance_id)); |
183 if (result->is_null()) | 182 if (result->is_null()) |
184 return; | 183 return; |
185 | 184 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( | 308 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( |
310 IntToPlatformFile(shared_memory_handle), false); | 309 IntToPlatformFile(shared_memory_handle), false); |
311 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) | 310 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) |
312 return PP_ERROR_FAILED; | 311 return PP_ERROR_FAILED; |
313 | 312 |
314 return PP_OK; | 313 return PP_OK; |
315 } | 314 } |
316 | 315 |
317 } // namespace proxy | 316 } // namespace proxy |
318 } // namespace ppapi | 317 } // namespace ppapi |
OLD | NEW |