Index: ppapi/proxy/ppb_audio_input_proxy.cc |
diff --git a/ppapi/proxy/ppb_audio_input_proxy.cc b/ppapi/proxy/ppb_audio_input_proxy.cc |
index 011e332afcdbbbee92907a4eebd770134f245806..242c5ec29a401a83282c0c462ee2fb8c50f91a01 100644 |
--- a/ppapi/proxy/ppb_audio_input_proxy.cc |
+++ b/ppapi/proxy/ppb_audio_input_proxy.cc |
@@ -286,21 +286,23 @@ void PPB_AudioInput_Proxy::OnMsgEnumerateDevicesACK( |
void PPB_AudioInput_Proxy::OnMsgOpenACK( |
const HostResource& audio_input, |
int32_t result, |
- IPC::PlatformFileForTransit socket_handle, |
- base::SharedMemoryHandle handle, |
- uint32_t length) { |
+ const ppapi::proxy::SerializedHandle& socket_handle, |
+ const ppapi::proxy::SerializedHandle& handle) { |
+ CHECK(socket_handle.is_socket()); |
+ CHECK(handle.is_shmem()); |
EnterPluginFromHostResource<PPB_AudioInput_API> enter(audio_input); |
if (enter.failed()) { |
// 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.shmem(), false); |
} else { |
static_cast<AudioInput*>(enter.object())->OnOpenComplete( |
- result, handle, length, |
- IPC::PlatformFileForTransitToPlatformFile(socket_handle)); |
+ result, handle.shmem(), handle.size(), |
+ IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor())); |
} |
} |
@@ -316,15 +318,21 @@ void PPB_AudioInput_Proxy::EnumerateDevicesACKInHost( |
void PPB_AudioInput_Proxy::OpenACKInHost(int32_t result, |
const HostResource& audio_input) { |
- IPC::PlatformFileForTransit socket_handle = |
- IPC::InvalidPlatformFileForTransit(); |
- base::SharedMemoryHandle shared_memory = IPC::InvalidPlatformFileForTransit(); |
- uint32_t shared_memory_length = 0; |
+ ppapi::proxy::SerializedHandle socket_handle( |
+ ppapi::proxy::SerializedHandle::SOCKET); |
+ ppapi::proxy::SerializedHandle shared_memory( |
+ ppapi::proxy::SerializedHandle::SHARED_MEMORY); |
if (result == PP_OK) { |
- result = GetAudioInputConnectedHandles(audio_input, &socket_handle, |
- &shared_memory, |
- &shared_memory_length); |
+ IPC::PlatformFileForTransit temp_socket; |
+ base::SharedMemoryHandle temp_shmem; |
+ uint32_t temp_size; |
+ result = GetAudioInputConnectedHandles(audio_input, &temp_socket, |
+ &temp_shmem, &temp_size); |
+ if (result == PP_OK) { |
+ socket_handle.set_socket(temp_socket); |
+ shared_memory.set_shmem(temp_shmem, temp_size); |
+ } |
} |
// Send all the values, even on error. This simplifies some of our cleanup |
@@ -334,7 +342,7 @@ void PPB_AudioInput_Proxy::OpenACKInHost(int32_t result, |
// (in OnMsgOpenACK), even in the failure case. |
dispatcher()->Send(new PpapiMsg_PPBAudioInput_OpenACK( |
API_ID_PPB_AUDIO_INPUT_DEV, audio_input, result, socket_handle, |
- shared_memory, shared_memory_length)); |
+ shared_memory)); |
} |
int32_t PPB_AudioInput_Proxy::GetAudioInputConnectedHandles( |