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

Unified Diff: ppapi/proxy/plugin_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/proxy/plugin_var_tracker.h ('k') | ppapi/shared_impl/resource_var.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_var_tracker.cc
diff --git a/ppapi/proxy/plugin_var_tracker.cc b/ppapi/proxy/plugin_var_tracker.cc
index ee299852514c865e85e08b5554db8c6251334f68..d2a4d74d0e3eaa34502beaace129e9e9d983c16b 100644
--- a/ppapi/proxy/plugin_var_tracker.cc
+++ b/ppapi/proxy/plugin_var_tracker.cc
@@ -10,10 +10,13 @@
#include "ppapi/c/ppb_var.h"
#include "ppapi/proxy/plugin_array_buffer_var.h"
#include "ppapi/proxy/plugin_dispatcher.h"
+#include "ppapi/proxy/plugin_resource_var.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/proxy_object_var.h"
#include "ppapi/shared_impl/api_id.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/proxy_lock.h"
+#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/shared_impl/var.h"
namespace ppapi {
@@ -151,6 +154,14 @@ void PluginVarTracker::ReleaseHostObject(PluginDispatcher* dispatcher,
ReleaseVar(found->second);
}
+ResourceVar* PluginVarTracker::MakeResourceVar(PP_Resource pp_resource) {
+ ResourceTracker* resource_tracker = PpapiGlobals::Get()->GetResourceTracker();
+ ppapi::Resource* resource = resource_tracker->GetResource(pp_resource);
+ if (!resource)
+ return NULL;
+ return new PluginResourceVar(resource);
+}
+
void PluginVarTracker::DidDeleteInstance(PP_Instance instance) {
// Calling the destructors on plugin objects may in turn release other
// objects which will mutate the map out from under us. So do a two-step
« no previous file with comments | « ppapi/proxy/plugin_var_tracker.h ('k') | ppapi/shared_impl/resource_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698