diff options
Diffstat (limited to 'ppapi/proxy/plugin_var_tracker.cc')
-rw-r--r-- | ppapi/proxy/plugin_var_tracker.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ppapi/proxy/plugin_var_tracker.cc b/ppapi/proxy/plugin_var_tracker.cc index ee29985..d2a4d74 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 |