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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc

Issue 8827005: Revert 113250 - Add CommandBuffer::SetGetBuffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc
===================================================================
--- ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc (revision 113254)
+++ ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc (working copy)
@@ -244,26 +244,40 @@
NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
PP_Resource resource_id,
+ int32_t size,
int32_t* success) {
DebugPrintf("PPB_Graphics3DTrusted_InitCommandBuffer(...) resource_id: %d\n",
resource_id);
NaClSrpcClosureRunner runner(done);
rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+ if ((size > kMaxAllowedBufferSize) || (size < 0))
+ return;
*success = ppapi_proxy::PPBGraphics3DTrustedInterface()->InitCommandBuffer(
- resource_id);
+ resource_id, size);
rpc->result = NACL_SRPC_RESULT_OK;
}
-void PpbGraphics3DRpcServer::PPB_Graphics3DTrusted_SetGetBuffer(
+
+void PpbGraphics3DRpcServer::PPB_Graphics3DTrusted_GetRingBuffer(
NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
PP_Resource resource_id,
- int32_t transfer_buffer_id) {
- DebugPrintf("PPB_Graphics3DTrusted_SetGetBuffer\n");
+ NaClSrpcImcDescType* shm_desc,
+ int32_t* shm_size) {
+ DebugPrintf("PPB_Graphics3DTrusted_GetRingBuffer\n");
+ nacl::DescWrapperFactory factory;
+ nacl::scoped_ptr<nacl::DescWrapper> desc_wrapper;
NaClSrpcClosureRunner runner(done);
rpc->result = NACL_SRPC_RESULT_APP_ERROR;
- ppapi_proxy::PPBGraphics3DTrustedInterface()->SetGetBuffer(
- resource_id, transfer_buffer_id);
+
+ int native_handle = 0;
+ uint32_t native_size = 0;
+ ppapi_proxy::PPBGraphics3DTrustedInterface()->GetRingBuffer(
+ resource_id, &native_handle, &native_size);
+ desc_wrapper.reset(factory.ImportShmHandle(
+ (NaClHandle)native_handle, native_size));
+ *shm_desc = desc_wrapper->desc();
+ *shm_size = native_size;
rpc->result = NACL_SRPC_RESULT_OK;
}
« no previous file with comments | « ppapi/c/trusted/ppb_graphics_3d_trusted.h ('k') | ppapi/native_client/src/shared/ppapi_proxy/command_buffer_nacl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698