| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GLUE_PLUGINS_PEPPER_RESOURCE_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "third_party/ppapi/c/pp_resource.h" | 10 #include "third_party/ppapi/c/pp_resource.h" |
| 11 | 11 |
| 12 namespace pepper { | 12 namespace pepper { |
| 13 | 13 |
| 14 class Buffer; | 14 class Buffer; |
| 15 class DeviceContext2D; | 15 class DeviceContext2D; |
| 16 class ImageData; | 16 class ImageData; |
| 17 class PluginModule; | 17 class PluginModule; |
| 18 class URLLoader; |
| 19 class URLRequestInfo; |
| 20 class URLResponseInfo; |
| 18 | 21 |
| 19 class Resource : public base::RefCountedThreadSafe<Resource> { | 22 class Resource : public base::RefCountedThreadSafe<Resource> { |
| 20 public: | 23 public: |
| 21 explicit Resource(PluginModule* module); | 24 explicit Resource(PluginModule* module); |
| 22 virtual ~Resource(); | 25 virtual ~Resource(); |
| 23 | 26 |
| 24 PP_Resource GetResource() const; | 27 PP_Resource GetResource() const; |
| 25 | 28 |
| 26 PluginModule* module() const { return module_; } | 29 PluginModule* module() const { return module_; } |
| 27 | 30 |
| 28 // Type-specific getters for individual resource types. These will return | 31 // Type-specific getters for individual resource types. These will return |
| 29 // NULL if the resource does not match the specified type. | 32 // NULL if the resource does not match the specified type. |
| 30 virtual DeviceContext2D* AsDeviceContext2D() { return NULL; } | 33 virtual DeviceContext2D* AsDeviceContext2D() { return NULL; } |
| 31 virtual ImageData* AsImageData() { return NULL; } | 34 virtual ImageData* AsImageData() { return NULL; } |
| 35 virtual URLLoader* AsURLLoader() { return NULL; } |
| 36 virtual URLRequestInfo* AsURLRequestInfo() { return NULL; } |
| 37 virtual URLResponseInfo* AsURLResponseInfo() { return NULL; } |
| 32 virtual Buffer* AsBuffer() { return NULL; } | 38 virtual Buffer* AsBuffer() { return NULL; } |
| 33 | 39 |
| 34 private: | 40 private: |
| 35 PluginModule* module_; // Non-owning pointer to our module. | 41 PluginModule* module_; // Non-owning pointer to our module. |
| 36 | 42 |
| 37 DISALLOW_COPY_AND_ASSIGN(Resource); | 43 DISALLOW_COPY_AND_ASSIGN(Resource); |
| 38 }; | 44 }; |
| 39 | 45 |
| 40 } // namespace pepper | 46 } // namespace pepper |
| 41 | 47 |
| 42 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ | 48 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ |
| OLD | NEW |