From edb5b05700f53fb7b1827727777cc15b50370ccb Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Mon, 18 Jun 2012 19:41:30 +0000 Subject: Actually free plugin implement vars when running out of process when the plugin holds a reference beyond the lifetime of the instance. Review URL: https://chromiumcodereview.appspot.com/10542150 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142787 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/shared_impl/test_globals.h | 2 ++ ppapi/shared_impl/var_tracker.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'ppapi/shared_impl') diff --git a/ppapi/shared_impl/test_globals.h b/ppapi/shared_impl/test_globals.h index 2fa2192..3675347 100644 --- a/ppapi/shared_impl/test_globals.h +++ b/ppapi/shared_impl/test_globals.h @@ -20,6 +20,8 @@ class TestVarTracker : public VarTracker { virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) OVERRIDE { return NULL; } + virtual void DidDeleteInstance(PP_Instance instance) OVERRIDE { + } }; // Implementation of PpapiGlobals for tests that don't need either the host- or diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h index 9ab22f2..b873250 100644 --- a/ppapi/shared_impl/var_tracker.h +++ b/ppapi/shared_impl/var_tracker.h @@ -11,6 +11,7 @@ #include "base/hash_tables.h" #include "base/memory/ref_counted.h" #include "base/threading/non_thread_safe.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_var.h" #include "ppapi/shared_impl/ppapi_shared_export.h" @@ -84,6 +85,9 @@ class PPAPI_SHARED_EXPORT VarTracker int GetRefCountForObject(const PP_Var& object); int GetTrackedWithNoReferenceCountForObject(const PP_Var& object); + // Called after an instance is deleted to do var cleanup. + virtual void DidDeleteInstance(PP_Instance instance) = 0; + protected: struct VarInfo { VarInfo(); -- cgit v1.1