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

Unified Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 1154613006: Update pepper to not assume that SharedMemoryHandle is an int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another nits pass. Created 5 years, 7 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
Index: ppapi/proxy/ppb_audio_proxy.cc
diff --git a/ppapi/proxy/ppb_audio_proxy.cc b/ppapi/proxy/ppb_audio_proxy.cc
index ca714355b839c69bbdff7b16443fb98463c247ba..daa0395d1f619121c790a6ecb11b96a2e919a557 100644
--- a/ppapi/proxy/ppb_audio_proxy.cc
+++ b/ppapi/proxy/ppb_audio_proxy.cc
@@ -50,7 +50,8 @@ class Audio : public Resource, public PPB_Audio_Shared {
int32_t Open(PP_Resource config_id,
scoped_refptr<TrackedCallback> create_callback) override;
int32_t GetSyncSocket(int* sync_socket) override;
- int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) override;
+ int32_t GetSharedMemory(base::SharedMemory** shm,
+ uint32_t* shm_size) override;
private:
// Owning reference to the current config object. This isn't actually used,
@@ -122,7 +123,7 @@ int32_t Audio::GetSyncSocket(int* sync_socket) {
return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface.
}
-int32_t Audio::GetSharedMemory(int* shm_handle, uint32_t* shm_size) {
+int32_t Audio::GetSharedMemory(base::SharedMemory** shm, uint32_t* shm_size) {
return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface.
}
@@ -246,7 +247,7 @@ void PPB_Audio_Proxy::AudioChannelConnected(
const HostResource& resource) {
IPC::PlatformFileForTransit socket_handle =
IPC::InvalidPlatformFileForTransit();
- base::SharedMemoryHandle shared_memory = IPC::InvalidPlatformFileForTransit();
+ base::SharedMemoryHandle shared_memory = base::SharedMemory::NULLHandle();
uint32_t audio_buffer_length = 0;
int32_t result_code = result;
@@ -290,16 +291,16 @@ int32_t PPB_Audio_Proxy::GetAudioConnectedHandles(
return PP_ERROR_FAILED;
// Get the shared memory for the buffer.
- int shared_memory_handle;
- result = enter.object()->GetSharedMemory(&shared_memory_handle,
- shared_memory_length);
+ base::SharedMemory* shared_memory;
+ result =
+ enter.object()->GetSharedMemory(&shared_memory, shared_memory_length);
if (result != PP_OK)
return result;
// shared_memory_handle doesn't belong to us: don't close it.
- *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote(
- IntToPlatformFile(shared_memory_handle), false);
- if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit())
+ *foreign_shared_memory_handle =
+ dispatcher()->ShareSharedMemoryHandleWithRemote(shared_memory->handle());
+ if (!base::SharedMemory::IsHandleValid(*foreign_shared_memory_handle))
return PP_ERROR_FAILED;
return PP_OK;

Powered by Google App Engine
This is Rietveld 408576698