summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/enter_proxy.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-18 21:58:02 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-18 21:58:02 +0000
commit4d2efd2e100bc961d3e19e0a6f242c7914917690 (patch)
treec29e1a627687c0ef29a207378ff19fcd9927fb67 /ppapi/proxy/enter_proxy.h
parent6fa9e6f0c0fd3a66789de9df381cc16c36ca6da1 (diff)
downloadchromium_src-4d2efd2e100bc961d3e19e0a6f242c7914917690.zip
chromium_src-4d2efd2e100bc961d3e19e0a6f242c7914917690.tar.gz
chromium_src-4d2efd2e100bc961d3e19e0a6f242c7914917690.tar.bz2
Convert the pp::proxy namespace to the ppapi::proxy namespace.
This is more consistent with the stuff in shared_impl, and removes a lot of namespace using goop. Add a unified resource tracker shared between the proxy and the impl. This renames the old ResourceObjectBase to Resource and removes the old PluginResource. It moves the resource tracker from the impl to the shared_impl, and makes the proxy use it. Some things become a little less neat because there's no proxy resource base class. In particular GetDispatcher() is now gone. I considered whether to add a helper base class that provides this function, but decided against it and had individual resource classes implement this when their implementation would find it useful. This is because ultimately I want more of this functionality to move into the shared_impl, and it's easier to do that if there are fewer proxy-specific things in the resources. This changes the way that plugins are added to the tracker. Previously they would only be in the tracker if the plugin had a reference to them, although they could be alive if the impl had a scoped_ptr referencing an object. This actually has the bug that if we then give the resource back to the plugin, it wouldn't be refcounted properly and everything would get confused. Now the tracker tracks all live resource objects whether or not the plugin has a ref. This works basically like the var tracker (it would be nice if the var and resource trackers shared more code, but that would further complicate this already overcomplicated patch). The resource tracker takes an extra ref whenever the plugin has one or more, and otherwise just tracks live resources. BUG= TEST= Review URL: http://codereview.chromium.org/7655002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/enter_proxy.h')
-rw-r--r--ppapi/proxy/enter_proxy.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/ppapi/proxy/enter_proxy.h b/ppapi/proxy/enter_proxy.h
index d710c6c..6852780 100644
--- a/ppapi/proxy/enter_proxy.h
+++ b/ppapi/proxy/enter_proxy.h
@@ -12,7 +12,7 @@
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/thunk/enter.h"
-namespace pp {
+namespace ppapi {
namespace proxy {
// Wrapper around EnterResourceNoLock that takes a host resource. This is used
@@ -23,10 +23,10 @@ namespace proxy {
// never logs errors since we assume the host is doing reasonable things.
template<typename ResourceT>
class EnterPluginFromHostResource
- : public ::ppapi::thunk::EnterResourceNoLock<ResourceT> {
+ : public thunk::EnterResourceNoLock<ResourceT> {
public:
- EnterPluginFromHostResource(const ppapi::HostResource& host_resource)
- : ::ppapi::thunk::EnterResourceNoLock<ResourceT>(
+ EnterPluginFromHostResource(const HostResource& host_resource)
+ : thunk::EnterResourceNoLock<ResourceT>(
PluginResourceTracker::GetInstance()->PluginResourceForHostResource(
host_resource),
false) {
@@ -40,10 +40,10 @@ class EnterPluginFromHostResource
template<typename ResourceT>
class EnterHostFromHostResource
- : public ::ppapi::thunk::EnterResourceNoLock<ResourceT> {
+ : public thunk::EnterResourceNoLock<ResourceT> {
public:
- EnterHostFromHostResource(const ppapi::HostResource& host_resource)
- : ::ppapi::thunk::EnterResourceNoLock<ResourceT>(
+ EnterHostFromHostResource(const HostResource& host_resource)
+ : thunk::EnterResourceNoLock<ResourceT>(
host_resource.host_resource(), false) {
// Validate that we're in the host rather than the plugin. Otherwise this
// object will do the wrong thing. In the host, the instance should have
@@ -91,7 +91,7 @@ class EnterHostFromHostResourceForceCallback
// implementations will use the 1-extra-argument constructor below.
template<class CallbackFactory, typename Method>
EnterHostFromHostResourceForceCallback(
- const ppapi::HostResource& host_resource,
+ const HostResource& host_resource,
CallbackFactory& factory,
Method method)
: EnterHostFromHostResource<ResourceT>(host_resource),
@@ -104,7 +104,7 @@ class EnterHostFromHostResourceForceCallback
// For callbacks that take an extra parameter as a closure.
template<class CallbackFactory, typename Method, typename A>
EnterHostFromHostResourceForceCallback(
- const ppapi::HostResource& host_resource,
+ const HostResource& host_resource,
CallbackFactory& factory,
Method method,
const A& a)
@@ -146,6 +146,6 @@ class EnterHostFromHostResourceForceCallback
};
} // namespace proxy
-} // namespace pp
+} // namespace ppapi
#endif // PPAPI_PROXY_ENTER_PROXY_H_