Chromium Code Reviews| Index: Source/bindings/templates/interface.h |
| diff --git a/Source/bindings/templates/interface.h b/Source/bindings/templates/interface.h |
| index b6eb271e46f578574c478edb198b6cfb8fdc2cbb..449cc86427ec9985b76680f5e6d79003e6db23fb 100644 |
| --- a/Source/bindings/templates/interface.h |
| +++ b/Source/bindings/templates/interface.h |
| @@ -27,6 +27,7 @@ |
| {% for filename in header_includes %} |
| #include "{{filename}}" |
| {% endfor %} |
| + |
| namespace WebCore { |
| class {{v8_class_name}} { |
| @@ -40,9 +41,7 @@ public: |
| } |
| static void derefObject(void*); |
| static WrapperTypeInfo info; |
| - |
| static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; |
| - |
| static inline void* toInternalPointer({{cpp_class_name}}* impl) |
| { |
| return impl; |
| @@ -52,14 +51,11 @@ public: |
| { |
| return static_cast<{{cpp_class_name}}*>(object); |
| } |
| - |
| static void installPerContextProperties(v8::Handle<v8::Object>, {{cpp_class_name}}*, v8::Isolate*) { } |
| static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8::Isolate*) { } |
| - |
| private: |
| friend v8::Handle<v8::Object> wrap({{cpp_class_name}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class_name}}>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| - |
| }; |
| template<> |
| @@ -68,6 +64,7 @@ public: |
| static WrapperTypeInfo* info() { return &{{v8_class_name}}::info; } |
| }; |
| + |
| inline v8::Handle<v8::Object> wrap({{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |
| ASSERT(impl); |
| @@ -85,11 +82,6 @@ inline v8::Handle<v8::Value> toV8({{cpp_class_name}}* impl, v8::Handle<v8::Objec |
| return wrap(impl, creationContext, isolate); |
| } |
| -inline v8::Handle<v8::Value> toV8(PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| -{ |
| - return toV8(impl.get(), creationContext, isolate); |
| -} |
| - |
| template<typename CallbackInfo> |
| inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext) |
| { |
| @@ -124,34 +116,41 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class_n |
| v8SetReturnValueNull(callbackInfo); |
| return; |
| } |
| - if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.GetHolder(), wrappable)) |
| + if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| return; |
| v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()); |
| v8SetReturnValue(callbackInfo, wrapper); |
| } |
| + |
| +inline v8::Handle<v8::Value> toV8(PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
|
haraken
2013/08/22 07:31:33
Nit: You don't need a space before {{cpp_class_nam
Nils Barth (inactive)
2013/08/22 09:08:13
(Perl compatibility.)
|
| +{ |
| + return toV8(impl.get(), creationContext, isolate); |
| +} |
| + |
| template<class CallbackInfo> |
| -inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext) |
| +inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext) |
| { |
| v8SetReturnValue(callbackInfo, impl.get(), creationContext); |
| } |
| template<class CallbackInfo> |
| -inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext) |
| +inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext) |
| { |
| v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext); |
| } |
| template<class CallbackInfo, class Wrappable> |
| -inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, Wrappable* wrappable) |
| +inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, Wrappable* wrappable) |
| { |
| v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| } |
| } |
| - |
| {% if conditional_string %} |
| + |
| #endif // {{conditional_string}} |
| {% endif %} |
| #endif // {{v8_class_name}}_h |
| + |