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

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

Issue 689013002: IDL: Generate trace() method in union container types when required (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/union.cpp
diff --git a/Source/bindings/templates/union.cpp b/Source/bindings/templates/union.cpp
index 7d9a501aa0a4bef1c0ef2e5a89dd99eca764f082..0972404fbb74f4e9b2391853f7de229e880847b9 100644
--- a/Source/bindings/templates/union.cpp
+++ b/Source/bindings/templates/union.cpp
@@ -34,6 +34,15 @@ void {{container.cpp_class}}::set{{member.type_name}}({{member.rvalue_cpp_type}}
}
{% endfor %}
+{% if container.needs_trace %}
+void {{container.cpp_class}}::trace(Visitor* visitor)
+{
+ {% for member in container.members if member.is_traceable %}
+ visitor->trace(m_{{member.cpp_name}});
+ {% endfor %}
+}
+
+{% endif %}
void V8{{container.cpp_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {{container.cpp_class}}& impl, ExceptionState& exceptionState)
{
{# FIXME: We don't follow the spec on handling null and undefined at this

Powered by Google App Engine
This is Rietveld 408576698