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

Side by Side Diff: ppapi/shared_impl/resource_tracker.h

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/shared_impl/resource_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // resource will have 0 plugin refcount. This is called by the resource 51 // resource will have 0 plugin refcount. This is called by the resource
52 // constructor. 52 // constructor.
53 // 53 //
54 // Returns 0 if the resource could not be added. 54 // Returns 0 if the resource could not be added.
55 virtual PP_Resource AddResource(Resource* object); 55 virtual PP_Resource AddResource(Resource* object);
56 56
57 // The opposite of AddResource, this removes the tracking information for 57 // The opposite of AddResource, this removes the tracking information for
58 // the given resource. It's called from the resource destructor. 58 // the given resource. It's called from the resource destructor.
59 virtual void RemoveResource(Resource* object); 59 virtual void RemoveResource(Resource* object);
60 60
61 // Calls LastPluginRefWasDeleted on the given resource object. This is
62 // provided because the derived class in webkit/plugins/ppapi needs to
63 // perform additional operations at this time.
64 virtual void LastPluginRefWasDeleted(Resource* object);
65
61 private: 66 private:
62 typedef std::set<PP_Resource> ResourceSet; 67 typedef std::set<PP_Resource> ResourceSet;
63 68
64 struct InstanceData { 69 struct InstanceData {
65 // Lists all resources associated with the given instance as non-owning 70 // Lists all resources associated with the given instance as non-owning
66 // pointers. This allows us to notify those resources that the instance is 71 // pointers. This allows us to notify those resources that the instance is
67 // going away (otherwise, they may crash if they outlive the instance). 72 // going away (otherwise, they may crash if they outlive the instance).
68 ResourceSet resources; 73 ResourceSet resources;
69 }; 74 };
70 typedef base::hash_map<PP_Instance, linked_ptr<InstanceData> > InstanceMap; 75 typedef base::hash_map<PP_Instance, linked_ptr<InstanceData> > InstanceMap;
(...skipping 13 matching lines...) Expand all
84 ResourceMap live_resources_; 89 ResourceMap live_resources_;
85 90
86 int32 last_resource_value_; 91 int32 last_resource_value_;
87 92
88 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); 93 DISALLOW_COPY_AND_ASSIGN(ResourceTracker);
89 }; 94 };
90 95
91 } // namespace ppapi 96 } // namespace ppapi
92 97
93 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ 98 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_
OLDNEW
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/shared_impl/resource_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698