OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class PluginInstance; | 27 class PluginInstance; |
28 class PluginModule; | 28 class PluginModule; |
29 class Resource; | 29 class Resource; |
30 class ResourceTrackerTest; | 30 class ResourceTrackerTest; |
31 class Var; | 31 class Var; |
32 | 32 |
33 // This class maintains a global list of all live pepper resources. It allows | 33 // This class maintains a global list of all live pepper resources. It allows |
34 // us to check resource ID validity and to map them to a specific module. | 34 // us to check resource ID validity and to map them to a specific module. |
35 // | 35 // |
36 // This object is threadsafe. | 36 // This object is NOT threadsafe. |
37 class ResourceTracker { | 37 class ResourceTracker { |
38 public: | 38 public: |
39 // Returns the pointer to the singleton object. | 39 // Returns the pointer to the singleton object. |
40 static ResourceTracker* Get(); | 40 static ResourceTracker* Get(); |
41 | 41 |
42 // PP_Resources -------------------------------------------------------------- | 42 // PP_Resources -------------------------------------------------------------- |
43 | 43 |
44 // The returned pointer will be NULL if there is no resource. Note that this | 44 // The returned pointer will be NULL if there is no resource. Note that this |
45 // return value is a scoped_refptr so that we ensure the resource is valid | 45 // return value is a scoped_refptr so that we ensure the resource is valid |
46 // from the point of the lookup to the point that the calling code needs it. | 46 // from the point of the lookup to the point that the calling code needs it. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 typedef std::map<PP_Module, PluginModule*> ModuleMap; | 162 typedef std::map<PP_Module, PluginModule*> ModuleMap; |
163 ModuleMap module_map_; | 163 ModuleMap module_map_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); | 165 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace ppapi | 168 } // namespace ppapi |
169 } // namespace webkit | 169 } // namespace webkit |
170 | 170 |
171 #endif // WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ | 171 #endif // WEBKIT_PLUGINS_PPAPI_RESOURCE_TRACKER_H_ |
OLD | NEW |