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

Unified Diff: ppapi/shared_impl/tracker_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/resource_object_base.h ('k') | ppapi/shared_impl/tracker_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/tracker_base.h
===================================================================
--- ppapi/shared_impl/tracker_base.h (revision 0)
+++ ppapi/shared_impl/tracker_base.h (revision 0)
@@ -0,0 +1,49 @@
+// 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_TRACKER_BASE_H_
+#define PPAPI_SHARED_IMPL_TRACKER_BASE_H_
+
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/proxy/interface_id.h"
+
+namespace ppapi {
+namespace shared_impl {
+
+class FunctionGroupBase;
+class ResourceObjectBase;
+
+// Tracks resource and function APIs, providing a mapping between ID and
+// object.
+// TODO(brettw) Eventually this should be one object with global tracking and
+// called "Tracker", and this would be used in both the plugin side of the
+// proxy as well as the implementation in the renderer. Currently, all this
+// does is forward to the process-type-specific tracker to get the information.
+class TrackerBase {
+ public:
+ // Must be called before any other function that uses the TrackerBase.
+ // This sets the getter that returns the global implmenetation of
+ // TrackerBase. It will be different for in the renderer and in the plugin
+ // process.
+ static void Init(TrackerBase*(*getter)());
+
+ // Retrieves the global tracker. This will be NULL if you haven't called
+ // Init() first (it should be unnecessary to NULL-check this).
+ static TrackerBase* Get();
+
+ // Returns the resource object corresponding to the given ID, or NULL if
+ // there isn't one.
+ virtual ResourceObjectBase* GetResourceAPI(PP_Resource res) = 0;
+
+ // Returns the function object corresponding to the given ID, or NULL if
+ // there isn't one.
+ virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst,
+ pp::proxy::InterfaceID id) = 0;
+};
+
+} // namespace shared_impl
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_TRACKER_BASE_H_
Property changes on: ppapi/shared_impl/tracker_base.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ppapi/shared_impl/resource_object_base.h ('k') | ppapi/shared_impl/tracker_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698