Chromium Code Reviews| Index: Source/bindings/templates/methods.cpp |
| diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
| index 8abf31b557d81605c1a586b54e305818044058d1..390376045eaa36992d4234ce99708cdb775cf917 100644 |
| --- a/Source/bindings/templates/methods.cpp |
| +++ b/Source/bindings/templates/methods.cpp |
| @@ -386,16 +386,23 @@ static void constructor{{constructor.overload_index}}(const v8::FunctionCallback |
| Document& document = *toDocument(currentExecutionContext(info.GetIsolate())); |
| {% endif %} |
| {{ref_ptr}}<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor.argument_list | join(', ')}}); |
| - v8::Handle<v8::Object> wrapper = info.Holder(); |
| {% if is_constructor_raises_exception %} |
| if (exceptionState.throwIfNeeded()) |
| return; |
| {% endif %} |
| - {# FIXME: Should probably be Independent unless [ActiveDOMObject] |
| - or [DependentLifetime]. #} |
| - V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent); |
| + {% if has_custom_wrap %} |
| + v8SetReturnValue(info, wrap(impl.get(), info.Holder(), info.GetIsolate())); |
| + {% else %} |
| + v8::Handle<v8::Object> wrapper = info.Holder(); |
| + {% set wrapper_configuration = 'WrapperConfiguration::Dependent' |
|
Nils Barth (inactive)
2014/03/24 02:14:20
Since we're using {{wrapper_configuration}} two pl
|
| + if (has_visit_dom_wrapper or |
| + is_active_dom_object or |
| + is_dependent_lifetime) else |
| + 'WrapperConfiguration::Independent' %} |
| + V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configuration}}); |
| v8SetReturnValue(info, wrapper); |
| + {% endif %} |
| } |
| {% endmacro %} |