summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 21:57:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 21:57:50 +0000
commit77ac44f19b5d1ead7c1b29900341fbfc07286ce6 (patch)
treea09b9951a19ca4a322fbd37a82438ed5e38ae44d /ppapi/thunk
parent6b292e3db6ccdda0477289b3d8c713f2707ae9ff (diff)
downloadchromium_src-77ac44f19b5d1ead7c1b29900341fbfc07286ce6.zip
chromium_src-77ac44f19b5d1ead7c1b29900341fbfc07286ce6.tar.gz
chromium_src-77ac44f19b5d1ead7c1b29900341fbfc07286ce6.tar.bz2
Add a new globals object for PPAPI tracking information.
This adds a specialization on the host and plugin side of the proxy. This replaces the ad-hoc singleton tracking done by the resource and var trackers with just being getters on this global object. Most code can use the single PpapiGlobals class. I also allow code to get the host and plugin specializations since some code needs access to some specific features of each side. In a later pass I'll move the other stuff out of TrackerBase and delete it. TEST=none BUG=none Review URL: http://codereview.chromium.org/8316008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/enter.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/ppapi/thunk/enter.h b/ppapi/thunk/enter.h
index 34fb706..faa556d 100644
--- a/ppapi/thunk/enter.h
+++ b/ppapi/thunk/enter.h
@@ -9,10 +9,11 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/proxy/interface_id.h"
#include "ppapi/shared_impl/function_group_base.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/resource.h"
-#include "ppapi/shared_impl/tracker_base.h"
#include "ppapi/shared_impl/resource_tracker.h"
+#include "ppapi/shared_impl/tracker_base.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/resource_creation_api.h"
@@ -116,7 +117,7 @@ class EnterFunctionGivenResource : public EnterFunction<FunctionsT> {
private:
static PP_Instance GetInstanceForResource(PP_Resource resource) {
Resource* object =
- TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(resource);
return object ? object->pp_instance() : 0;
}
};
@@ -128,7 +129,8 @@ class EnterResource : subtle::LockOnEntry<lock_on_entry> {
public:
EnterResource(PP_Resource resource, bool report_error)
: object_(NULL) {
- resource_ = TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
+ resource_ =
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(resource);
if (resource_)
object_ = resource_->GetAs<ResourceT>();
// TODO(brettw) check error and if report_error is set, do something.