| Index: ppapi/proxy/plugin_resource_tracker.cc
|
| ===================================================================
|
| --- ppapi/proxy/plugin_resource_tracker.cc (revision 84344)
|
| +++ ppapi/proxy/plugin_resource_tracker.cc (working copy)
|
| @@ -10,6 +10,7 @@
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| #include "ppapi/proxy/plugin_resource.h"
|
| #include "ppapi/proxy/serialized_var.h"
|
| +#include "ppapi/shared_impl/tracker_base.h"
|
|
|
| namespace pp {
|
| namespace proxy {
|
| @@ -19,6 +20,10 @@
|
| // When non-NULL, this object overrides the ResourceTrackerSingleton.
|
| PluginResourceTracker* g_resource_tracker_override = NULL;
|
|
|
| +::ppapi::shared_impl::TrackerBase* GetTrackerBase() {
|
| + return PluginResourceTracker::GetInstance();
|
| +}
|
| +
|
| } // namespace
|
|
|
| PluginResourceTracker::ResourceInfo::ResourceInfo() : ref_count(0) {
|
| @@ -33,6 +38,8 @@
|
| PluginResourceTracker::ResourceInfo::ResourceInfo(const ResourceInfo& other)
|
| : ref_count(other.ref_count),
|
| resource(other.resource) {
|
| + // Wire up the new shared resource tracker base to use our implementation.
|
| + ::ppapi::shared_impl::TrackerBase::Init(&GetTrackerBase);
|
| }
|
|
|
| PluginResourceTracker::ResourceInfo::~ResourceInfo() {
|
| @@ -67,6 +74,12 @@
|
| return Singleton<PluginResourceTracker>::get();
|
| }
|
|
|
| +// static
|
| +::ppapi::shared_impl::TrackerBase*
|
| +PluginResourceTracker::GetTrackerBaseInstance() {
|
| + return GetInstance();
|
| +}
|
| +
|
| PluginResource* PluginResourceTracker::GetResourceObject(
|
| PP_Resource pp_resource) {
|
| ResourceMap::iterator found = resource_map_.find(pp_resource);
|
| @@ -112,6 +125,23 @@
|
| return found->second;
|
| }
|
|
|
| +::ppapi::shared_impl::ResourceObjectBase* PluginResourceTracker::GetResourceAPI(
|
| + PP_Resource res) {
|
| + ResourceMap::iterator found = resource_map_.find(res);
|
| + if (found == resource_map_.end())
|
| + return NULL;
|
| + return found->second.resource.get();
|
| +}
|
| +
|
| +::ppapi::shared_impl::FunctionGroupBase* PluginResourceTracker::GetFunctionAPI(
|
| + PP_Instance inst,
|
| + pp::proxy::InterfaceID id) {
|
| + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(inst);
|
| + if (dispatcher)
|
| + return dispatcher->GetFunctionAPI(id);
|
| + return NULL;
|
| +}
|
| +
|
| void PluginResourceTracker::ReleasePluginResourceRef(
|
| const PP_Resource& resource,
|
| bool notify_browser_on_release) {
|
|
|