summaryrefslogtreecommitdiffstats
path: root/webkit
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 /webkit
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 'webkit')
-rw-r--r--webkit/plugins/ppapi/resource_tracker.cc16
-rw-r--r--webkit/plugins/ppapi/resource_tracker.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/webkit/plugins/ppapi/resource_tracker.cc b/webkit/plugins/ppapi/resource_tracker.cc
index 1405a30..18211e7 100644
--- a/webkit/plugins/ppapi/resource_tracker.cc
+++ b/webkit/plugins/ppapi/resource_tracker.cc
@@ -58,7 +58,7 @@ struct ResourceTracker::InstanceData {
// Lazily allocated function proxies for the different interfaces.
scoped_ptr< ::ppapi::FunctionGroupBase >
- function_proxies[::pp::proxy::INTERFACE_ID_COUNT];
+ function_proxies[::ppapi::proxy::INTERFACE_ID_COUNT];
};
// static
@@ -118,7 +118,7 @@ void ResourceTracker::CleanupInstanceData(PP_Instance instance,
::ppapi::FunctionGroupBase* ResourceTracker::GetFunctionAPI(
PP_Instance pp_instance,
- pp::proxy::InterfaceID id) {
+ ::ppapi::proxy::InterfaceID id) {
// Get the instance object. This also ensures that the instance data is in
// the map, since we need it below.
PluginInstance* instance = GetInstance(pp_instance);
@@ -127,7 +127,7 @@ void ResourceTracker::CleanupInstanceData(PP_Instance instance,
// The instance one is special, since it's just implemented by the instance
// object.
- if (id == pp::proxy::INTERFACE_ID_PPB_INSTANCE)
+ if (id == ::ppapi::proxy::INTERFACE_ID_PPB_INSTANCE)
return instance;
scoped_ptr< ::ppapi::FunctionGroupBase >& proxy =
@@ -136,19 +136,19 @@ void ResourceTracker::CleanupInstanceData(PP_Instance instance,
return proxy.get();
switch (id) {
- case pp::proxy::INTERFACE_ID_PPB_CHAR_SET:
+ case ::ppapi::proxy::INTERFACE_ID_PPB_CHAR_SET:
proxy.reset(new PPB_CharSet_Impl(instance));
break;
- case pp::proxy::INTERFACE_ID_PPB_CURSORCONTROL:
+ case ::ppapi::proxy::INTERFACE_ID_PPB_CURSORCONTROL:
proxy.reset(new PPB_CursorControl_Impl(instance));
break;
- case pp::proxy::INTERFACE_ID_PPB_FIND:
+ case ::ppapi::proxy::INTERFACE_ID_PPB_FIND:
proxy.reset(new PPB_Find_Impl(instance));
break;
- case pp::proxy::INTERFACE_ID_PPB_FONT:
+ case ::ppapi::proxy::INTERFACE_ID_PPB_FONT:
proxy.reset(new PPB_Font_FunctionImpl(instance));
break;
- case pp::proxy::INTERFACE_ID_RESOURCE_CREATION:
+ case ::ppapi::proxy::INTERFACE_ID_RESOURCE_CREATION:
proxy.reset(new ResourceCreationImpl(instance));
break;
default:
diff --git a/webkit/plugins/ppapi/resource_tracker.h b/webkit/plugins/ppapi/resource_tracker.h
index 3a33b4f..4802fab 100644
--- a/webkit/plugins/ppapi/resource_tracker.h
+++ b/webkit/plugins/ppapi/resource_tracker.h
@@ -54,7 +54,7 @@ class ResourceTracker : public ::ppapi::TrackerBase,
// TrackerBase.
virtual ::ppapi::FunctionGroupBase* GetFunctionAPI(
PP_Instance pp_instance,
- pp::proxy::InterfaceID id) OVERRIDE;
+ ::ppapi::proxy::InterfaceID id) OVERRIDE;
virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE;
virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE;