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

Unified Diff: ppapi/proxy/ppb_buffer_proxy.cc

Issue 10828023: PPAPI/NaCl: Make NaClIPCAdapter transfer handles more generally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add gyp files Created 8 years, 4 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_buffer_proxy.h ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_buffer_proxy.cc
diff --git a/ppapi/proxy/ppb_buffer_proxy.cc b/ppapi/proxy/ppb_buffer_proxy.cc
index 6c4561d6413ec92a75e56439a90a967282b52398..813d340521c2ec25ccace430ceea43bb9c03a309 100644
--- a/ppapi/proxy/ppb_buffer_proxy.cc
+++ b/ppapi/proxy/ppb_buffer_proxy.cc
@@ -75,14 +75,14 @@ PP_Resource PPB_Buffer_Proxy::CreateProxyResource(PP_Instance instance,
return 0;
HostResource result;
- base::SharedMemoryHandle shm_handle = base::SharedMemory::NULLHandle();
+ ppapi::proxy::SerializedHandle shm_handle;
dispatcher->Send(new PpapiHostMsg_PPBBuffer_Create(
- API_ID_PPB_BUFFER, instance, size,
- &result, &shm_handle));
- if (result.is_null() || !base::SharedMemory::IsHandleValid(shm_handle))
+ API_ID_PPB_BUFFER, instance, size, &result, &shm_handle));
+ if (result.is_null() || !shm_handle.IsHandleValid() ||
+ !shm_handle.is_shmem())
return 0;
- return AddProxyResource(result, shm_handle, size);
+ return AddProxyResource(result, shm_handle.shmem(), size);
}
// static
@@ -107,9 +107,9 @@ void PPB_Buffer_Proxy::OnMsgCreate(
PP_Instance instance,
uint32_t size,
HostResource* result_resource,
- base::SharedMemoryHandle* result_shm_handle) {
+ ppapi::proxy::SerializedHandle* result_shm_handle) {
// Overwritten below on success.
- *result_shm_handle = base::SharedMemory::NULLHandle();
+ result_shm_handle->set_null_shmem();
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
if (!dispatcher)
return;
@@ -142,7 +142,8 @@ void PPB_Buffer_Proxy::OnMsgCreate(
#else
#error Not implemented.
#endif
- *result_shm_handle = dispatcher->ShareHandleWithRemote(platform_file, false);
+ result_shm_handle->set_shmem(
+ dispatcher->ShareHandleWithRemote(platform_file, false), size);
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/ppb_buffer_proxy.h ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698