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

Unified Diff: ppapi/shared_impl/var_tracker.h

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.cc ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var_tracker.h
diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h
index d7fb49ccfe06c07867739ab71808b3abef55b2fc..379f645bbf87d54c69d8fbb2230895fedf92e70e 100644
--- a/ppapi/shared_impl/var_tracker.h
+++ b/ppapi/shared_impl/var_tracker.h
@@ -85,6 +85,15 @@ class PPAPI_SHARED_EXPORT VarTracker {
// usually immediately put this in a scoped_refptr).
ArrayBufferVar* MakeArrayBufferVar(uint32 size_in_bytes, const void* data);
+ // Creates a new resource var that points to a given resource ID. Returns a
+ // PP_Var that references it and has an initial reference count of 1.
+ PP_Var MakeResourcePPVar(PP_Resource pp_resource);
+
+ // Creates a new resource var that points to a given resource ID. This is
+ // implemented by the host and plugin tracker separately, because the plugin
+ // keeps a reference to the resource, and the host does not.
+ virtual ResourceVar* MakeResourceVar(PP_Resource pp_resource) = 0;
+
// Return a vector containing all PP_Vars that are in the tracker. This is
// to help implement PPB_Testing_Dev.GetLiveVars and should generally not be
// used in production code. The PP_Vars are returned in no particular order,
« no previous file with comments | « ppapi/shared_impl/var.cc ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698