diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 22:55:47 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 22:55:47 +0000 |
commit | 6239d34076222cbfe1d42770c604822b0ba894f4 (patch) | |
tree | d873cdf138b002bb2d2d4a554ba4fcd210251760 /ppapi/proxy/plugin_resource_tracker.h | |
parent | c50a948dd9c07a71524949a28a5347e11d80da47 (diff) | |
download | chromium_src-6239d34076222cbfe1d42770c604822b0ba894f4.zip chromium_src-6239d34076222cbfe1d42770c604822b0ba894f4.tar.gz chromium_src-6239d34076222cbfe1d42770c604822b0ba894f4.tar.bz2 |
This implements the new system for Graphics2D only.
This works by adding a new thunk layer that will forward to an "API" that's either per-instance (function APIs) or per-resource (resource APIs). The proxying and such is then implemented in terms of this C++ API.
Ideally the trackers of the PP_Resource/PP_Instance -> object mapping would be shared between the plugin and renderer processes. To keep this patch under control, I did this as a virtual base class which is implemented by ppapi::proxy::PluginResourceTracker and webkit::ppapi::ResourceTracker. Later, the functionality of these objects should be shared in a common tracker class.
Still to do it a lot of cleanup and merging of things. Also, the namespaces are a bit out of control.
Review URL: http://codereview.chromium.org/6905088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84519 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_resource_tracker.h')
-rw-r--r-- | ppapi/proxy/plugin_resource_tracker.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ppapi/proxy/plugin_resource_tracker.h b/ppapi/proxy/plugin_resource_tracker.h index f0d25f23..268709f 100644 --- a/ppapi/proxy/plugin_resource_tracker.h +++ b/ppapi/proxy/plugin_resource_tracker.h @@ -15,6 +15,7 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_var.h" #include "ppapi/proxy/host_resource.h" +#include "ppapi/shared_impl/tracker_base.h" template<typename T> struct DefaultSingletonTraits; @@ -24,7 +25,7 @@ namespace proxy { class PluginDispatcher; class PluginResource; -class PluginResourceTracker { +class PluginResourceTracker : public ::ppapi::shared_impl::TrackerBase { public: // Called by tests that want to specify a specific ResourceTracker. This // allows them to use a unique one each time and avoids singletons sticking @@ -33,6 +34,7 @@ class PluginResourceTracker { // Returns the global singleton resource tracker for the plugin. static PluginResourceTracker* GetInstance(); + static ::ppapi::shared_impl::TrackerBase* GetTrackerBaseInstance(); // Returns the object associated with the given resource ID, or NULL if // there isn't one. @@ -52,6 +54,13 @@ class PluginResourceTracker { PP_Resource PluginResourceForHostResource( const HostResource& resource) const; + // TrackerBase. + virtual ::ppapi::shared_impl::ResourceObjectBase* GetResourceAPI( + PP_Resource res); + virtual ::ppapi::shared_impl::FunctionGroupBase* GetFunctionAPI( + PP_Instance inst, + pp::proxy::InterfaceID id); + private: friend struct DefaultSingletonTraits<PluginResourceTracker>; friend class PluginResourceTrackerTest; |