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 |