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

Unified Diff: ppapi/proxy/ppapi_command_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/plugin_dispatcher_unittest.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppapi_command_buffer_proxy.cc
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 91cd268eb8f8c6d8f87bcb16fd15cdd64dc9f63b..282a8765bb7110bca510f7eeedf83fb76616a588 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -225,27 +225,29 @@ gpu::Buffer PpapiCommandBufferProxy::GetTransferBuffer(int32 id) {
// Assuming we are in the renderer process, the service is responsible for
// duplicating the handle. This might not be true for NaCl.
- base::SharedMemoryHandle handle;
- uint32 size;
+ ppapi::proxy::SerializedHandle handle(
+ ppapi::proxy::SerializedHandle::SHARED_MEMORY);
if (!Send(new PpapiHostMsg_PPBGraphics3D_GetTransferBuffer(
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id, &handle, &size))) {
+ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id, &handle))) {
return gpu::Buffer();
}
+ if (!handle.is_shmem())
+ return gpu::Buffer();
// Cache the transfer buffer shared memory object client side.
scoped_ptr<base::SharedMemory> shared_memory(
- new base::SharedMemory(handle, false));
+ new base::SharedMemory(handle.shmem(), false));
// Map the shared memory on demand.
if (!shared_memory->memory()) {
- if (!shared_memory->Map(size)) {
+ if (!shared_memory->Map(handle.size())) {
return gpu::Buffer();
}
}
gpu::Buffer buffer;
buffer.ptr = shared_memory->memory();
- buffer.size = size;
+ buffer.size = handle.size();
buffer.shared_memory = shared_memory.release();
transfer_buffers_[id] = buffer;
« no previous file with comments | « ppapi/proxy/plugin_dispatcher_unittest.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698