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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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_TRACKER_BASE_H_
6 #define PPAPI_SHARED_IMPL_TRACKER_BASE_H_
7
8 #include "ppapi/c/pp_instance.h"
9 #include "ppapi/c/pp_resource.h"
10 #include "ppapi/proxy/interface_id.h"
11
12 namespace ppapi {
13 namespace shared_impl {
14
15 class FunctionGroupBase;
16 class ResourceObjectBase;
17
18 // Tracks resource and function APIs, providing a mapping between ID and
19 // object.
20 // TODO(brettw) Eventually this should be one object with global tracking and
21 // called "Tracker", and this would be used in both the plugin side of the
22 // proxy as well as the implementation in the renderer. Currently, all this
23 // does is forward to the process-type-specific tracker to get the information.
24 class TrackerBase {
25 public:
26 // Must be called before any other function that uses the TrackerBase.
27 // This sets the getter that returns the global implmenetation of
28 // TrackerBase. It will be different for in the renderer and in the plugin
29 // process.
30 static void Init(TrackerBase*(*getter)());
31
32 // Retrieves the global tracker. This will be NULL if you haven't called
33 // Init() first (it should be unnecessary to NULL-check this).
34 static TrackerBase* Get();
35
36 // Returns the resource object corresponding to the given ID, or NULL if
37 // there isn't one.
38 virtual ResourceObjectBase* GetResourceAPI(PP_Resource res) = 0;
39
40 // Returns the function object corresponding to the given ID, or NULL if
41 // there isn't one.
42 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst,
43 pp::proxy::InterfaceID id) = 0;
44 };
45
46 } // namespace shared_impl
47 } // namespace ppapi
48
49 #endif // PPAPI_SHARED_IMPL_TRACKER_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698