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

Unified Diff: ppapi/shared_impl/var_tracker.cc

Issue 23809016: [PPAPI] ResourceVar now reference counts its PP_Resource in the plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Windows compile. Created 7 years, 3 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/shared_impl/var_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var_tracker.cc
diff --git a/ppapi/shared_impl/var_tracker.cc b/ppapi/shared_impl/var_tracker.cc
index 254c51ab579f3d71fefb3126be2c4c505083e5a1..bada0ab76dd137bfcb859cbe243b3adbc36446dd 100644
--- a/ppapi/shared_impl/var_tracker.cc
+++ b/ppapi/shared_impl/var_tracker.cc
@@ -13,6 +13,7 @@
#include "ppapi/shared_impl/host_resource.h"
#include "ppapi/shared_impl/id_assignment.h"
#include "ppapi/shared_impl/proxy_lock.h"
+#include "ppapi/shared_impl/resource_var.h"
#include "ppapi/shared_impl/var.h"
namespace ppapi {
@@ -234,6 +235,13 @@ PP_Var VarTracker::MakeArrayBufferPPVar(uint32 size_in_bytes,
return array_buffer->GetPPVar();
}
+PP_Var VarTracker::MakeResourcePPVar(PP_Resource pp_resource) {
+ CheckThreadingPreconditions();
+
+ ResourceVar* resource_var = MakeResourceVar(pp_resource);
+ return resource_var ? resource_var->GetPPVar() : PP_MakeNull();
+}
+
std::vector<PP_Var> VarTracker::GetLiveVars() {
CheckThreadingPreconditions();
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698