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 PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ |
6 #define PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ | 6 #define PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
17 #include "ppapi/proxy/plugin_var_tracker.h" | 17 #include "ppapi/proxy/plugin_var_tracker.h" |
| 18 #include "ppapi/proxy/ppapi_proxy_export.h" |
18 #include "ppapi/shared_impl/host_resource.h" | 19 #include "ppapi/shared_impl/host_resource.h" |
19 #include "ppapi/shared_impl/resource_tracker.h" | 20 #include "ppapi/shared_impl/resource_tracker.h" |
20 #include "ppapi/shared_impl/tracker_base.h" | 21 #include "ppapi/shared_impl/tracker_base.h" |
21 | 22 |
22 template<typename T> struct DefaultSingletonTraits; | 23 template<typename T> struct DefaultSingletonTraits; |
23 | 24 |
24 namespace ppapi { | 25 namespace ppapi { |
25 | 26 |
26 class Var; | 27 class Var; |
27 | 28 |
28 namespace proxy { | 29 namespace proxy { |
29 | 30 |
30 class PluginDispatcher; | 31 class PluginDispatcher; |
31 | 32 |
32 class PluginResourceTracker : public TrackerBase, public ResourceTracker { | 33 class PPAPI_PROXY_EXPORT PluginResourceTracker : public TrackerBase, |
| 34 public ResourceTracker { |
33 public: | 35 public: |
34 // Called by tests that want to specify a specific ResourceTracker. This | 36 // Called by tests that want to specify a specific ResourceTracker. This |
35 // allows them to use a unique one each time and avoids singletons sticking | 37 // allows them to use a unique one each time and avoids singletons sticking |
36 // around across tests. | 38 // around across tests. |
37 static void SetInstanceForTest(PluginResourceTracker* tracker); | 39 static void SetInstanceForTest(PluginResourceTracker* tracker); |
38 | 40 |
39 // Returns the global singleton resource tracker for the plugin. | 41 // Returns the global singleton resource tracker for the plugin. |
40 static PluginResourceTracker* GetInstance(); | 42 static PluginResourceTracker* GetInstance(); |
41 static TrackerBase* GetTrackerBaseInstance(); | 43 static TrackerBase* GetTrackerBaseInstance(); |
42 | 44 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 typedef std::map<HostResource, PP_Resource> HostResourceMap; | 91 typedef std::map<HostResource, PP_Resource> HostResourceMap; |
90 HostResourceMap host_resource_map_; | 92 HostResourceMap host_resource_map_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); | 94 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); |
93 }; | 95 }; |
94 | 96 |
95 } // namespace proxy | 97 } // namespace proxy |
96 } // namespace ppapi | 98 } // namespace ppapi |
97 | 99 |
98 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ | 100 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ |
OLD | NEW |