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

Unified Diff: ppapi/thunk/enter.h

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/enter.h
diff --git a/ppapi/thunk/enter.h b/ppapi/thunk/enter.h
index ea2fc82b84f24105eb080e49ee104849c41efd9b..e7f0d0f1661a1032d6ffcb3de9dadea0f172deed 100644
--- a/ppapi/thunk/enter.h
+++ b/ppapi/thunk/enter.h
@@ -9,8 +9,9 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/proxy/interface_id.h"
#include "ppapi/shared_impl/function_group_base.h"
-#include "ppapi/shared_impl/resource_object_base.h"
+#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/tracker_base.h"
+#include "ppapi/shared_impl/resource_tracker.h"
namespace ppapi {
namespace thunk {
@@ -77,9 +78,15 @@ template<typename FunctionsT>
class EnterFunctionGivenResource : public EnterFunction<FunctionsT> {
public:
EnterFunctionGivenResource(PP_Resource resource, bool report_error)
- : EnterFunction<FunctionsT>(
- TrackerBase::Get()->GetInstanceForResource(resource),
- report_error) {
+ : EnterFunction<FunctionsT>(GetInstanceForResource(resource),
+ report_error) {
+ }
+
+ private:
+ static PP_Instance GetInstanceForResource(PP_Resource resource) {
+ Resource* object =
+ TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
+ return object ? object->pp_instance() : 0;
}
};
@@ -90,7 +97,8 @@ class EnterResource {
public:
EnterResource(PP_Resource resource, bool report_error)
: object_(NULL) {
- ResourceObjectBase* base = TrackerBase::Get()->GetResourceAPI(resource);
+ Resource* base =
+ TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
if (base)
object_ = base->GetAs<ResourceT>();
// TODO(brettw) check error and if report_error is set, do something.

Powered by Google App Engine
This is Rietveld 408576698