Index: ppapi/shared_impl/resource_object_base.h |
=================================================================== |
--- ppapi/shared_impl/resource_object_base.h (revision 84713) |
+++ ppapi/shared_impl/resource_object_base.h (working copy) |
@@ -8,6 +8,7 @@ |
namespace ppapi { |
namespace thunk { |
+class PPB_Font_API; |
class PPB_Graphics2D_API; |
class PPB_ImageData_API; |
} |
@@ -17,6 +18,7 @@ |
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 @@ |
}; |
template<> |
+inline thunk::PPB_Font_API* ResourceObjectBase::GetAs() { |
+ return AsFont_API(); |
+} |
+template<> |
inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() { |
return AsGraphics2D_API(); |
} |