| 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_PLUGINS_PPAPI_RESOURCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_RESOURCE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_RESOURCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_RESOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
| 11 #include "ppapi/shared_impl/resource_object_base.h" | 10 #include "ppapi/shared_impl/resource_object_base.h" |
| 12 #include "webkit/plugins/ppapi/resource_tracker.h" | 11 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 13 | 12 |
| 14 namespace webkit { | 13 namespace webkit { |
| 15 namespace ppapi { | 14 namespace ppapi { |
| 16 | 15 |
| 17 class Resource : public base::RefCountedThreadSafe<Resource>, | 16 class Resource : public ::ppapi::ResourceObjectBase { |
| 18 public ::ppapi::ResourceObjectBase { | |
| 19 public: | 17 public: |
| 20 explicit Resource(PluginInstance* instance); | 18 explicit Resource(PluginInstance* instance); |
| 21 virtual ~Resource(); | 19 virtual ~Resource(); |
| 22 | 20 |
| 23 // Returns the instance owning this resource. This is generally to be | 21 // Returns the instance owning this resource. This is generally to be |
| 24 // non-NULL except if the instance is destroyed and some code internal to the | 22 // non-NULL except if the instance is destroyed and some code internal to the |
| 25 // PPAPI implementation is keeping a reference for some reason. | 23 // PPAPI implementation is keeping a reference for some reason. |
| 26 PluginInstance* instance() const { return instance_; } | 24 PluginInstance* instance() const { return instance_; } |
| 27 | 25 |
| 28 // Clears the instance pointer when the associated PluginInstance will be | 26 // Clears the instance pointer when the associated PluginInstance will be |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Non-owning pointer to our instance. See getter above. | 82 // Non-owning pointer to our instance. See getter above. |
| 85 PluginInstance* instance_; | 83 PluginInstance* instance_; |
| 86 | 84 |
| 87 DISALLOW_COPY_AND_ASSIGN(Resource); | 85 DISALLOW_COPY_AND_ASSIGN(Resource); |
| 88 }; | 86 }; |
| 89 | 87 |
| 90 } // namespace ppapi | 88 } // namespace ppapi |
| 91 } // namespace webkit | 89 } // namespace webkit |
| 92 | 90 |
| 93 #endif // WEBKIT_PLUGINS_PPAPI_RESOURCE_H_ | 91 #endif // WEBKIT_PLUGINS_PPAPI_RESOURCE_H_ |
| OLD | NEW |