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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "third_party/ppapi/c/pp_resource.h" | 11 #include "third_party/ppapi/c/pp_resource.h" |
12 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 12 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
13 | 13 |
14 namespace pepper { | 14 namespace pepper { |
15 | 15 |
16 class Buffer; | 16 class Buffer; |
17 class DeviceContext2D; | 17 class DeviceContext2D; |
18 class DirectoryReader; | 18 class DirectoryReader; |
19 class FileChooser; | 19 class FileChooser; |
20 class FileIO; | 20 class FileIO; |
21 class FileRef; | 21 class FileRef; |
22 class Font; | 22 class Font; |
23 class ImageData; | 23 class ImageData; |
24 class PluginModule; | 24 class PluginModule; |
| 25 class PrivateFontFile; |
25 class Scrollbar; | 26 class Scrollbar; |
26 class URLLoader; | 27 class URLLoader; |
27 class URLRequestInfo; | 28 class URLRequestInfo; |
28 class URLResponseInfo; | 29 class URLResponseInfo; |
29 class Widget; | 30 class Widget; |
30 | 31 |
31 class Resource : public base::RefCountedThreadSafe<Resource> { | 32 class Resource : public base::RefCountedThreadSafe<Resource> { |
32 public: | 33 public: |
33 explicit Resource(PluginModule* module) : resource_id_(0), module_(module) {} | 34 explicit Resource(PluginModule* module) : resource_id_(0), module_(module) {} |
34 virtual ~Resource() {} | 35 virtual ~Resource() {} |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // NULL if the resource does not match the specified type. Used by the Cast() | 74 // NULL if the resource does not match the specified type. Used by the Cast() |
74 // function. | 75 // function. |
75 virtual Buffer* AsBuffer() { return NULL; } | 76 virtual Buffer* AsBuffer() { return NULL; } |
76 virtual DeviceContext2D* AsDeviceContext2D() { return NULL; } | 77 virtual DeviceContext2D* AsDeviceContext2D() { return NULL; } |
77 virtual DirectoryReader* AsDirectoryReader() { return NULL; } | 78 virtual DirectoryReader* AsDirectoryReader() { return NULL; } |
78 virtual FileChooser* AsFileChooser() { return NULL; } | 79 virtual FileChooser* AsFileChooser() { return NULL; } |
79 virtual FileIO* AsFileIO() { return NULL; } | 80 virtual FileIO* AsFileIO() { return NULL; } |
80 virtual FileRef* AsFileRef() { return NULL; } | 81 virtual FileRef* AsFileRef() { return NULL; } |
81 virtual Font* AsFont() { return NULL; } | 82 virtual Font* AsFont() { return NULL; } |
82 virtual ImageData* AsImageData() { return NULL; } | 83 virtual ImageData* AsImageData() { return NULL; } |
| 84 virtual PrivateFontFile* AsPrivateFontFile() { return NULL; } |
83 virtual Scrollbar* AsScrollbar() { return NULL; } | 85 virtual Scrollbar* AsScrollbar() { return NULL; } |
84 virtual URLLoader* AsURLLoader() { return NULL; } | 86 virtual URLLoader* AsURLLoader() { return NULL; } |
85 virtual URLRequestInfo* AsURLRequestInfo() { return NULL; } | 87 virtual URLRequestInfo* AsURLRequestInfo() { return NULL; } |
86 virtual URLResponseInfo* AsURLResponseInfo() { return NULL; } | 88 virtual URLResponseInfo* AsURLResponseInfo() { return NULL; } |
87 virtual Widget* AsWidget() { return NULL; } | 89 virtual Widget* AsWidget() { return NULL; } |
88 | 90 |
89 private: | 91 private: |
90 // If referenced by a plugin, holds the id of this resource object. Do not | 92 // If referenced by a plugin, holds the id of this resource object. Do not |
91 // access this member directly, because it is possible that the plugin holds | 93 // access this member directly, because it is possible that the plugin holds |
92 // no references to the object, and therefore the resource_id_ is zero. Use | 94 // no references to the object, and therefore the resource_id_ is zero. Use |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 DEFINE_RESOURCE_CAST(Scrollbar) | 128 DEFINE_RESOURCE_CAST(Scrollbar) |
127 DEFINE_RESOURCE_CAST(URLLoader) | 129 DEFINE_RESOURCE_CAST(URLLoader) |
128 DEFINE_RESOURCE_CAST(URLRequestInfo) | 130 DEFINE_RESOURCE_CAST(URLRequestInfo) |
129 DEFINE_RESOURCE_CAST(URLResponseInfo) | 131 DEFINE_RESOURCE_CAST(URLResponseInfo) |
130 DEFINE_RESOURCE_CAST(Widget) | 132 DEFINE_RESOURCE_CAST(Widget) |
131 | 133 |
132 #undef DEFINE_RESOURCE_CAST | 134 #undef DEFINE_RESOURCE_CAST |
133 } // namespace pepper | 135 } // namespace pepper |
134 | 136 |
135 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ | 137 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ |
OLD | NEW |