| 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_SHARED_IMPL_RESOURCE_TRACKER_H_ | 5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ |
| 6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ | 6 #define PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
| 15 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 15 | 16 |
| 16 namespace ppapi { | 17 namespace ppapi { |
| 17 | 18 |
| 18 class Resource; | 19 class Resource; |
| 19 | 20 |
| 20 class ResourceTracker { | 21 class PPAPI_SHARED_EXPORT ResourceTracker { |
| 21 public: | 22 public: |
| 22 ResourceTracker(); | 23 ResourceTracker(); |
| 23 virtual ~ResourceTracker(); | 24 virtual ~ResourceTracker(); |
| 24 | 25 |
| 25 // The returned pointer will be NULL if there is no resource. The reference | 26 // The returned pointer will be NULL if there is no resource. The reference |
| 26 // count of the resource is unaffected. | 27 // count of the resource is unaffected. |
| 27 Resource* GetResource(PP_Resource res) const; | 28 Resource* GetResource(PP_Resource res) const; |
| 28 | 29 |
| 29 void AddRefResource(PP_Resource res); | 30 void AddRefResource(PP_Resource res); |
| 30 void ReleaseResource(PP_Resource res); | 31 void ReleaseResource(PP_Resource res); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 ResourceMap live_resources_; | 90 ResourceMap live_resources_; |
| 90 | 91 |
| 91 int32 last_resource_value_; | 92 int32 last_resource_value_; |
| 92 | 93 |
| 93 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); | 94 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 } // namespace ppapi | 97 } // namespace ppapi |
| 97 | 98 |
| 98 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ | 99 #endif // PPAPI_SHARED_IMPL_RESOURCE_TRACKER_H_ |
| OLD | NEW |