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

Unified Diff: webkit/plugins/ppapi/resource_tracker.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « webkit/plugins/ppapi/resource_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/resource_tracker.cc
===================================================================
--- webkit/plugins/ppapi/resource_tracker.cc (revision 71973)
+++ webkit/plugins/ppapi/resource_tracker.cc (working copy)
@@ -123,18 +123,13 @@
live_resources_.erase(i);
}
-uint32 ResourceTracker::GetLiveObjectsForModule(PluginModule* module) const {
- // Since this is for testing only, we'll just go through all of them and
- // count.
- //
- // TODO(brettw) we will eventually need to implement more efficient
- // module->resource lookup to free resources when a module is unloaded. In
- // this case, this function can be implemented using that system.
- uint32 count = 0;
- for (ResourceMap::const_iterator i = live_resources_.begin();
- i != live_resources_.end(); ++i)
- count++;
- return count;
+uint32 ResourceTracker::GetLiveObjectsForInstance(
+ PP_Instance instance) const {
+ InstanceToResourceMap::const_iterator found =
+ instance_to_resources_.find(instance);
+ if (found == instance_to_resources_.end())
+ return 0;
+ return static_cast<uint32>(found->second.size());
}
scoped_refptr<Var> ResourceTracker::GetVar(int32 var_id) const {
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698