| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ |
| 6 #define PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ |
| 7 |
| 8 namespace ppapi { |
| 9 |
| 10 namespace thunk { |
| 11 class PPB_Graphics2D_API; |
| 12 class PPB_ImageData_API; |
| 13 } |
| 14 |
| 15 namespace shared_impl { |
| 16 |
| 17 class ResourceObjectBase { |
| 18 public: |
| 19 |
| 20 virtual thunk::PPB_Graphics2D_API* AsGraphics2D_API() { return NULL; } |
| 21 virtual thunk::PPB_ImageData_API* AsImageData_API() { return NULL; } |
| 22 |
| 23 template <typename T> T* GetAs() { return NULL; } |
| 24 }; |
| 25 |
| 26 template<> |
| 27 inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() { |
| 28 return AsGraphics2D_API(); |
| 29 } |
| 30 template<> |
| 31 inline thunk::PPB_ImageData_API* ResourceObjectBase::GetAs() { |
| 32 return AsImageData_API(); |
| 33 } |
| 34 |
| 35 } // namespace shared_impl |
| 36 } // namespace ppapi |
| 37 |
| 38 #endif // PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ |
| OLD | NEW |