Index: src/shared/ppapi_proxy/plugin_resource_tracker.h |
diff --git a/src/shared/ppapi_proxy/plugin_resource_tracker.h b/src/shared/ppapi_proxy/plugin_resource_tracker.h |
index 613f5c6037932eac607bcddbfdd043495866fb90..2e67e5c3fa3b242e34fd58cce4f34363005c109a 100644 |
--- a/src/shared/ppapi_proxy/plugin_resource_tracker.h |
+++ b/src/shared/ppapi_proxy/plugin_resource_tracker.h |
@@ -43,9 +43,11 @@ class PluginResourceTracker { |
// Prohibit creation other then by the Singleton class. |
PluginResourceTracker(); |
- // Adds the given resource to the tracker and assigns it a resource ID and |
- // refcount of 1. Used only by the Resource class. |
- void AddResource(PluginResource* resource, PP_Resource id); |
+ // Adds the given resource to the tracker and assigns it a resource ID, local |
+ // refcount of 1, and initializes the browser reference count to |
+ // |browser_refcount|. Used only by the Resource class. |
+ void AddResource(PluginResource* resource, PP_Resource id, |
+ size_t browser_refcount); |
// The returned pointer will be NULL if there is no resource. Note that this |
// return value is a scoped_refptr so that we ensure the resource is valid |
@@ -57,8 +59,9 @@ class PluginResourceTracker { |
// Get or create a new PluginResource from a browser resource. |
// If we are already tracking this resource, we bump its browser_refcount to |
// reflect that we took ownership of it. If this is a new resource, we create |
- // a PluginResource for it with browser_refcount 1. |
- template<typename T> scoped_refptr<T> AdoptBrowserResource(PP_Resource res); |
+ // a PluginResource for it with the given browser_refcount. |
+ template<typename T> scoped_refptr<T> AdoptBrowserResource( |
+ PP_Resource res, size_t browser_refcount); |
// Try to get a browser-side refcount for an existing resource. |
void ObtainBrowserResource(PP_Resource res); |
@@ -73,7 +76,7 @@ class PluginResourceTracker { |
scoped_refptr<PluginResource> resource; |
size_t browser_refcount; |
size_t plugin_refcount; |
- explicit ResourceAndRefCounts(PluginResource* r); |
+ explicit ResourceAndRefCounts(PluginResource* r, size_t browser_refcount); |
sehr (please use chromium)
2011/07/20 00:33:41
Nit. explicit isn't strictly necessary for a binar
dmichael (off chromium)
2011/07/20 03:50:22
Done.
|
~ResourceAndRefCounts(); |
}; |
typedef std::map<PP_Resource, ResourceAndRefCounts> ResourceMap; |