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

Unified Diff: Source/bindings/templates/methods.cpp

Issue 196343032: Implement ImageData constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Generate code that custom wrap()s constructor instances Created 6 years, 9 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
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 %}
« no previous file with comments | « LayoutTests/fast/canvas/script-tests/canvas-ImageData.js ('k') | Source/bindings/tests/idls/TestInterfacePython2.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698