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

Unified Diff: gin/function_template.h

Issue 105423003: gin::Wrappable shouldn't inherit from base::RefCounted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.h.pump » ('j') | gin/handle.h » ('J')
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 020357d12fda7d938eee7620f70f25ccfbd8086b..a81e50b66761241bb3777bc5de7ff28abbc2942a 100644
--- a/gin/function_template.h
+++ b/gin/function_template.h
@@ -15,6 +15,7 @@
#include "base/logging.h"
#include "gin/arguments.h"
#include "gin/converter.h"
+#include "gin/handle.h"
#include "gin/public/gin_embedders.h"
#include "gin/public/wrapper_info.h"
#include "gin/wrappable.h"
@@ -306,10 +307,11 @@ v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<R()> callback) {
typedef internal::CallbackHolder<R()> HolderT;
- scoped_refptr<HolderT> holder(new HolderT(callback));
+ gin::Handle<HolderT> holder = CreateHandle(isolate, new HolderT(callback));
return v8::FunctionTemplate::New(
+ isolate,
&internal::DispatchToCallback<R>,
- ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
+ ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.Get()));
}
template<typename R, typename P1>
@@ -317,10 +319,11 @@ v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<R(P1)> callback) {
typedef internal::CallbackHolder<R(P1)> HolderT;
- scoped_refptr<HolderT> holder(new HolderT(callback));
+ gin::Handle<HolderT> holder = CreateHandle(isolate, new HolderT(callback));
return v8::FunctionTemplate::New(
+ isolate,
&internal::DispatchToCallback<R, P1>,
- ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
+ ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.Get()));
}
template<typename R, typename P1, typename P2>
@@ -328,10 +331,11 @@ v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<R(P1, P2)> callback) {
typedef internal::CallbackHolder<R(P1, P2)> HolderT;
- scoped_refptr<HolderT> holder(new HolderT(callback));
+ gin::Handle<HolderT> holder = CreateHandle(isolate, new HolderT(callback));
return v8::FunctionTemplate::New(
+ isolate,
&internal::DispatchToCallback<R, P1, P2>,
- ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
+ ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.Get()));
}
template<typename R, typename P1, typename P2, typename P3>
@@ -339,10 +343,11 @@ v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<R(P1, P2, P3)> callback) {
typedef internal::CallbackHolder<R(P1, P2, P3)> HolderT;
- scoped_refptr<HolderT> holder(new HolderT(callback));
+ gin::Handle<HolderT> holder = CreateHandle(isolate, new HolderT(callback));
return v8::FunctionTemplate::New(
+ isolate,
abarth-chromium 2013/12/04 21:33:08 Not sure where this part of the diff is coming fro
Aaron Boodman 2013/12/04 22:04:42 Hm. Perhaps.
&internal::DispatchToCallback<R, P1, P2, P3>,
- ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
+ ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.Get()));
}
template<typename R, typename P1, typename P2, typename P3, typename P4>
@@ -350,10 +355,11 @@ v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<R(P1, P2, P3, P4)> callback) {
typedef internal::CallbackHolder<R(P1, P2, P3, P4)> HolderT;
- scoped_refptr<HolderT> holder(new HolderT(callback));
+ gin::Handle<HolderT> holder = CreateHandle(isolate, new HolderT(callback));
return v8::FunctionTemplate::New(
+ isolate,
&internal::DispatchToCallback<R, P1, P2, P3, P4>,
- ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
+ ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.Get()));
}
} // namespace gin
« no previous file with comments | « no previous file | gin/function_template.h.pump » ('j') | gin/handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698