| 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_FUNCTION_GROUP_BASE_H_ |
| 6 #define PPAPI_SHARED_IMPL_FUNCTION_GROUP_BASE_H_ |
| 7 |
| 8 namespace ppapi { |
| 9 |
| 10 namespace thunk { |
| 11 class ResourceCreationAPI; |
| 12 } |
| 13 |
| 14 namespace shared_impl { |
| 15 |
| 16 class FunctionGroupBase { |
| 17 public: |
| 18 // Dynamic casting for this object. Returns the pointer to the given type if |
| 19 // it's supported. |
| 20 virtual thunk::ResourceCreationAPI* AsResourceCreation() { return NULL; } |
| 21 |
| 22 template <typename T> T* GetAs() { return NULL; } |
| 23 }; |
| 24 |
| 25 template<> |
| 26 inline thunk::ResourceCreationAPI* FunctionGroupBase::GetAs() { |
| 27 return AsResourceCreation(); |
| 28 } |
| 29 |
| 30 } // namespace shared_impl |
| 31 } // namespace ppapi |
| 32 |
| 33 #endif // PPAPI_SHARED_IMPL_FUNCTION_GROUP_BASE_H_ |
| OLD | NEW |