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 "base/synchronization/lock.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
15 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
17 #include "ppapi/proxy/plugin_var_tracker.h" | 18 #include "ppapi/proxy/plugin_var_tracker.h" |
18 #include "ppapi/proxy/ppapi_proxy_export.h" | 19 #include "ppapi/proxy/ppapi_proxy_export.h" |
19 #include "ppapi/shared_impl/host_resource.h" | 20 #include "ppapi/shared_impl/host_resource.h" |
20 #include "ppapi/shared_impl/resource_tracker.h" | 21 #include "ppapi/shared_impl/resource_tracker.h" |
21 #include "ppapi/shared_impl/tracker_base.h" | 22 #include "ppapi/shared_impl/tracker_base.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 PluginVarTracker var_tracker_; | 85 PluginVarTracker var_tracker_; |
85 | 86 |
86 // Non-owning pointer to a var tracker mock used by tests. NULL when no | 87 // Non-owning pointer to a var tracker mock used by tests. NULL when no |
87 // test implementation is provided. | 88 // test implementation is provided. |
88 PluginVarTracker* var_tracker_test_override_; | 89 PluginVarTracker* var_tracker_test_override_; |
89 | 90 |
90 // Map of host instance/resource pairs to a plugin resource ID. | 91 // Map of host instance/resource pairs to a plugin resource ID. |
91 typedef std::map<HostResource, PP_Resource> HostResourceMap; | 92 typedef std::map<HostResource, PP_Resource> HostResourceMap; |
92 HostResourceMap host_resource_map_; | 93 HostResourceMap host_resource_map_; |
93 | 94 |
| 95 // The global lock for the plugin side of the proxy. |
| 96 base::Lock proxy_lock_; |
| 97 |
94 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); | 98 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); |
95 }; | 99 }; |
96 | 100 |
97 } // namespace proxy | 101 } // namespace proxy |
98 } // namespace ppapi | 102 } // namespace ppapi |
99 | 103 |
100 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ | 104 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ |
OLD | NEW |