summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/var_tracker.h
diff options
context:
space:
mode:
authormgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 15:09:21 +0000
committermgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 15:09:21 +0000
commitc82b014311d37cc8c4ea0c54e41d1925fd7a3df4 (patch)
treee055d0451d810f83b107b13d8c9569c7eea13ed8 /ppapi/shared_impl/var_tracker.h
parenteb856a5fc49d6efbf06118d43b453b1be4859540 (diff)
downloadchromium_src-c82b014311d37cc8c4ea0c54e41d1925fd7a3df4.zip
chromium_src-c82b014311d37cc8c4ea0c54e41d1925fd7a3df4.tar.gz
chromium_src-c82b014311d37cc8c4ea0c54e41d1925fd7a3df4.tar.bz2
[PPAPI] ResourceVar now reference counts its Resource in the plugin.
ResourceVar is now an abstract base class with subclasses HostResourceVar and PluginResourceVar. The PluginResourceVar has a reference counted Resource instead of a PP_Resource. VarTracker has MakeResourceVar and MakeResourcePPVar methods, to abstract over the creation of a resource var of the correct subclass. Also, the creation_message is now NULL when empty, instead of being an empty message object. BUG=290713 Review URL: https://chromiumcodereview.appspot.com/23809016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/var_tracker.h')
-rw-r--r--ppapi/shared_impl/var_tracker.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h
index d7fb49c..379f645 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,