Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: ppapi/shared_impl/resource_object_base.h

Issue 6905088: New thunk system for Pepper proxy and implementation (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/function_group_base.h ('k') | ppapi/shared_impl/tracker_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/resource_object_base.h
===================================================================
--- ppapi/shared_impl/resource_object_base.h (revision 0)
+++ ppapi/shared_impl/resource_object_base.h (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
+#define PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
+
+namespace ppapi {
+
+namespace thunk {
+class PPB_Graphics2D_API;
+class PPB_ImageData_API;
+}
+
+namespace shared_impl {
+
+class ResourceObjectBase {
+ public:
+
+ virtual thunk::PPB_Graphics2D_API* AsGraphics2D_API() { return NULL; }
+ virtual thunk::PPB_ImageData_API* AsImageData_API() { return NULL; }
+
+ template <typename T> T* GetAs() { return NULL; }
+};
+
+template<>
+inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() {
+ return AsGraphics2D_API();
+}
+template<>
+inline thunk::PPB_ImageData_API* ResourceObjectBase::GetAs() {
+ return AsImageData_API();
+}
+
+} // namespace shared_impl
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
Property changes on: ppapi/shared_impl/resource_object_base.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ppapi/shared_impl/function_group_base.h ('k') | ppapi/shared_impl/tracker_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698