| 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" | |
| 13 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
| 14 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 16 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
| 18 #include "ppapi/proxy/ppapi_proxy_export.h" | 17 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 19 #include "ppapi/shared_impl/host_resource.h" | 18 #include "ppapi/shared_impl/host_resource.h" |
| 20 #include "ppapi/shared_impl/resource_tracker.h" | 19 #include "ppapi/shared_impl/resource_tracker.h" |
| 21 | 20 |
| 22 template<typename T> struct DefaultSingletonTraits; | 21 template<typename T> struct DefaultSingletonTraits; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 protected: | 37 protected: |
| 39 // ResourceTracker overrides. | 38 // ResourceTracker overrides. |
| 40 virtual PP_Resource AddResource(Resource* object) OVERRIDE; | 39 virtual PP_Resource AddResource(Resource* object) OVERRIDE; |
| 41 virtual void RemoveResource(Resource* object) OVERRIDE; | 40 virtual void RemoveResource(Resource* object) OVERRIDE; |
| 42 | 41 |
| 43 private: | 42 private: |
| 44 // Map of host instance/resource pairs to a plugin resource ID. | 43 // Map of host instance/resource pairs to a plugin resource ID. |
| 45 typedef std::map<HostResource, PP_Resource> HostResourceMap; | 44 typedef std::map<HostResource, PP_Resource> HostResourceMap; |
| 46 HostResourceMap host_resource_map_; | 45 HostResourceMap host_resource_map_; |
| 47 | 46 |
| 48 // The global lock for the plugin side of the proxy. | |
| 49 base::Lock proxy_lock_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); | 47 DISALLOW_COPY_AND_ASSIGN(PluginResourceTracker); |
| 52 }; | 48 }; |
| 53 | 49 |
| 54 } // namespace proxy | 50 } // namespace proxy |
| 55 } // namespace ppapi | 51 } // namespace ppapi |
| 56 | 52 |
| 57 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ | 53 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_TRACKER_H_ |
| OLD | NEW |