summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/resource_object_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/shared_impl/resource_object_base.h')
-rw-r--r--ppapi/shared_impl/resource_object_base.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ppapi/shared_impl/resource_object_base.h b/ppapi/shared_impl/resource_object_base.h
index 50ba30d..1a87360 100644
--- a/ppapi/shared_impl/resource_object_base.h
+++ b/ppapi/shared_impl/resource_object_base.h
@@ -8,6 +8,7 @@
namespace ppapi {
namespace thunk {
+class PPB_Font_API;
class PPB_Graphics2D_API;
class PPB_ImageData_API;
}
@@ -17,6 +18,7 @@ namespace shared_impl {
class ResourceObjectBase {
public:
+ virtual thunk::PPB_Font_API* AsFont_API() { return NULL; }
virtual thunk::PPB_Graphics2D_API* AsGraphics2D_API() { return NULL; }
virtual thunk::PPB_ImageData_API* AsImageData_API() { return NULL; }
@@ -24,6 +26,10 @@ class ResourceObjectBase {
};
template<>
+inline thunk::PPB_Font_API* ResourceObjectBase::GetAs() {
+ return AsFont_API();
+}
+template<>
inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() {
return AsGraphics2D_API();
}