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

Unified Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 10796064: PPAPI/NaCl: Make nacl_ipc_adapter handle ImageData creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sketch of idea for extracting handles generally Created 8 years, 5 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_proxy.h ('k') | ppapi/proxy/ppb_buffer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_audio_proxy.cc
diff --git a/ppapi/proxy/ppb_audio_proxy.cc b/ppapi/proxy/ppb_audio_proxy.cc
index f60ac812127e96804d053ddf7ac1e5d76cc8014b..98eb4bb65ee1cd530dad059246300609774e5fcd 100644
--- a/ppapi/proxy/ppb_audio_proxy.cc
+++ b/ppapi/proxy/ppb_audio_proxy.cc
@@ -252,9 +252,11 @@ void PPB_Audio_Proxy::AudioChannelConnected(
// inconvenient to clean up. Our IPC code will automatically handle this for
// us, as long as the remote side always closes the handles it receives
// (in OnMsgNotifyAudioStreamCreated), even in the failure case.
+ ppapi::proxy::SerializedFileDescriptor fd_wrapper = { socket_handle };
+ ppapi::proxy::SerializedSharedMemoryHandle handle_wrapper =
+ { shared_memory, shared_memory_length + sizeof(int32) };
dispatcher()->Send(new PpapiMsg_PPBAudio_NotifyAudioStreamCreated(
- API_ID_PPB_AUDIO, resource, result_code, socket_handle,
- shared_memory, shared_memory_length));
+ API_ID_PPB_AUDIO, resource, result_code, fd_wrapper, handle_wrapper));
}
int32_t PPB_Audio_Proxy::GetAudioConnectedHandles(
@@ -299,21 +301,21 @@ int32_t PPB_Audio_Proxy::GetAudioConnectedHandles(
void PPB_Audio_Proxy::OnMsgNotifyAudioStreamCreated(
const HostResource& audio_id,
int32_t result_code,
- IPC::PlatformFileForTransit socket_handle,
- base::SharedMemoryHandle handle,
- uint32_t length) {
+ ppapi::proxy::SerializedFileDescriptor socket_handle,
+ ppapi::proxy::SerializedSharedMemoryHandle handle) {
EnterPluginFromHostResource<PPB_Audio_API> enter(audio_id);
if (enter.failed() || result_code != PP_OK) {
// The caller may still have given us these handles in the failure case.
// The easiest way to clean these up is to just put them in the objects
// and then close them. This failure case is not performance critical.
base::SyncSocket temp_socket(
- IPC::PlatformFileForTransitToPlatformFile(socket_handle));
- base::SharedMemory temp_mem(handle, false);
+ IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor));
+ base::SharedMemory temp_mem(handle.handle, false);
} else {
static_cast<Audio*>(enter.object())->SetStreamInfo(
- enter.resource()->pp_instance(), handle, length,
- IPC::PlatformFileForTransitToPlatformFile(socket_handle));
+ enter.resource()->pp_instance(), handle.handle,
+ length - sizeof(uint32_t),
+ IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor));
}
}
« no previous file with comments | « ppapi/proxy/ppb_audio_proxy.h ('k') | ppapi/proxy/ppb_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698