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

Unified Diff: src/shared/ppapi_proxy/browser_core.cc

Issue 5581011: Resource tracking done right. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Updated for CoreInterface->PPBCoreInterface rename Created 10 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
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/plugin_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/ppapi_proxy/browser_core.cc
diff --git a/src/shared/ppapi_proxy/browser_core.cc b/src/shared/ppapi_proxy/browser_core.cc
index 66cb67fcb5002ea7e6a64231c0151ffdfab60538..79b92d56402a929ce1c2d2f690131f57939158d2 100644
--- a/src/shared/ppapi_proxy/browser_core.cc
+++ b/src/shared/ppapi_proxy/browser_core.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "native_client/src/include/portability.h"
+#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
#include "srpcgen/ppb_rpc.h"
//
@@ -13,9 +14,7 @@ void PpbCoreRpcServer::PPB_Core_AddRefResource(NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
int64_t resource) {
NaClSrpcClosureRunner runner(done);
- rpc->result = NACL_SRPC_RESULT_APP_ERROR;
- // TODO(sehr): implement AddRefResource.
- UNREFERENCED_PARAMETER(resource);
+ ppapi_proxy::PPBCoreInterface()->AddRefResource(resource);
rpc->result = NACL_SRPC_RESULT_OK;
}
@@ -23,9 +22,7 @@ void PpbCoreRpcServer::PPB_Core_ReleaseResource(NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
int64_t resource) {
NaClSrpcClosureRunner runner(done);
- rpc->result = NACL_SRPC_RESULT_APP_ERROR;
- // TODO(sehr): implement ReleaseResource.
- UNREFERENCED_PARAMETER(resource);
+ ppapi_proxy::PPBCoreInterface()->ReleaseResource(resource);
rpc->result = NACL_SRPC_RESULT_OK;
}
@@ -36,12 +33,22 @@ void PpbCoreRpcServer::PPB_Core_GetTime(NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
double* time) {
NaClSrpcClosureRunner runner(done);
- rpc->result = NACL_SRPC_RESULT_APP_ERROR;
- // TODO(sehr): implement time.
- *time = 0.0;
+ *time = ppapi_proxy::PPBCoreInterface()->GetTime();
rpc->result = NACL_SRPC_RESULT_OK;
}
+// Release multiple references at once.
+void PpbCoreRpcServer::ReleaseResourceMultipleTimes(NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ int64_t resource,
+ int32_t count) {
+ NaClSrpcClosureRunner runner(done);
+ while (count--)
+ ppapi_proxy::PPBCoreInterface()->ReleaseResource(resource);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+
// CallOnMainThread is handled on the upcall thread, where another RPC service
// is exported.
//
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/plugin_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698