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

Unified Diff: ppapi/shared_impl/resource_object_base.h

Issue 7461147: Add the PP_Instance to resource object base. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 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
« no previous file with comments | « ppapi/proxy/plugin_resource.cc ('k') | ppapi/shared_impl/resource_object_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/resource_object_base.h
diff --git a/ppapi/shared_impl/resource_object_base.h b/ppapi/shared_impl/resource_object_base.h
index 8f5da77ebd644ec320128e60dacc12eb53e88bc2..8621974dc6bbdc1d51141207ad396f5d3d01be34 100644
--- a/ppapi/shared_impl/resource_object_base.h
+++ b/ppapi/shared_impl/resource_object_base.h
@@ -8,6 +8,7 @@
#include <stddef.h> // For NULL.
#include "base/memory/ref_counted.h"
+#include "ppapi/c/pp_instance.h"
#define FOR_ALL_PPAPI_RESOURCE_APIS(F) \
F(PPB_AudioConfig_API) \
@@ -55,8 +56,11 @@ FOR_ALL_PPAPI_RESOURCE_APIS(DECLARE_RESOURCE_CLASS)
class ResourceObjectBase : public base::RefCounted<ResourceObjectBase> {
public:
+ ResourceObjectBase(PP_Instance instance);
viettrungluu 2011/08/10 20:17:34 explicit
virtual ~ResourceObjectBase();
+ PP_Instance pp_instance() const { return pp_instance_; }
+
// Dynamic casting for this object. Returns the pointer to the given type if
// Inheritance-based dynamic casting for this object. Returns the pointer to
// the given type if it's supported. Derived classes override the functions
@@ -68,6 +72,11 @@ class ResourceObjectBase : public base::RefCounted<ResourceObjectBase> {
// Template-based dynamic casting. See specializations below.
template <typename T> T* GetAs() { return NULL; }
+
+ private:
+ PP_Instance pp_instance_;
+
+ DISALLOW_COPY_AND_ASSIGN(ResourceObjectBase);
viettrungluu 2011/08/10 20:17:34 DISALLOW_IMPLICIT_CONSTRUCTORS to disallow the def
};
// Template-based dynamic casting. These specializations forward to the
« no previous file with comments | « ppapi/proxy/plugin_resource.cc ('k') | ppapi/shared_impl/resource_object_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698