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

Unified Diff: gin/function_template.h

Issue 105743007: Gin: Make it easier to implement Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years 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 | « no previous file | gin/function_template.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/function_template.h
diff --git a/gin/function_template.h b/gin/function_template.h
index 67df90e966246e64f0a3d663ba223347c078ef45..86ca1a6235cf3c0780eecfce866eceef1a845f69 100644
--- a/gin/function_template.h
+++ b/gin/function_template.h
@@ -32,7 +32,6 @@ enum CreateFunctionTemplateFlags {
namespace internal {
-// TODO(aa): Move this to base/template_util.h as remove_const.
template<typename T>
struct CallbackParamTraits {
typedef T LocalType;
@@ -56,12 +55,12 @@ struct CallbackParamTraits<const T*> {
// It inherits from Wrappable, which delete itself when both (a) the refcount
// via base::RefCounted has dropped to zero, and (b) there are no more
// JavaScript references in V8.
-class CallbackHolderBase : public Wrappable {
- public:
- virtual WrapperInfo* GetWrapperInfo() OVERRIDE;
- static WrapperInfo kWrapperInfo;
+
+// This simple base class is used so that we can share a single object template
+// among every CallbackHolder instance.
+class CallbackHolderBase : public Wrappable<CallbackHolderBase> {
protected:
- virtual ~CallbackHolderBase() {}
+ ~CallbackHolderBase() {}
};
template<typename Sig>
@@ -72,7 +71,7 @@ class CallbackHolder : public CallbackHolderBase {
base::Callback<Sig> callback;
int flags;
private:
- virtual ~CallbackHolder() {}
+ ~CallbackHolder() {}
};
« no previous file with comments | « no previous file | gin/function_template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698