OLD | NEW |
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 WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "native_client/src/include/nacl_base.h" | 11 #include "native_client/src/include/nacl_base.h" |
12 #include "native_client/src/include/ref_counted.h" | 12 #include "native_client/src/include/ref_counted.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_module.h" | 14 #include "ppapi/c/pp_module.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 | 16 |
17 namespace ppapi_proxy { | 17 namespace ppapi_proxy { |
18 | 18 |
19 class PluginInstance; | |
20 class PluginResource; | 19 class PluginResource; |
21 | 20 |
22 // This class maintains a global list of all live pepper resources. It allows | 21 // This class maintains a global list of all live pepper resources. It allows |
23 // us to check resource ID validity and to map them to a specific module. | 22 // us to check resource ID validity and to map them to a specific module. |
24 // | 23 // |
25 // This object is threadsafe. | 24 // This object is threadsafe. |
26 class PluginResourceTracker { | 25 class PluginResourceTracker { |
27 public: | 26 public: |
28 // Returns the pointer to the singleton object. | 27 // Returns the pointer to the singleton object. |
29 static PluginResourceTracker* Get() { | 28 static PluginResourceTracker* Get() { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 }; | 80 }; |
82 typedef std::map<PP_Resource, ResourceAndRefCounts> ResourceMap; | 81 typedef std::map<PP_Resource, ResourceAndRefCounts> ResourceMap; |
83 ResourceMap live_resources_; | 82 ResourceMap live_resources_; |
84 | 83 |
85 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); | 84 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); |
86 }; | 85 }; |
87 | 86 |
88 } // namespace ppapi_proxy | 87 } // namespace ppapi_proxy |
89 | 88 |
90 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ | 89 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_TRACKER_H_ |
91 | |
OLD | NEW |