Index: Source/bindings/templates/interface.cpp |
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp |
index 7a52a835454614793d759fa1a00727b8ec181018..28204a139f4403aa4507e45f44644a8baa5e5da2 100644 |
--- a/Source/bindings/templates/interface.cpp |
+++ b/Source/bindings/templates/interface.cpp |
@@ -678,7 +678,7 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
{##############################################################################} |
{% block visit_dom_wrapper %} |
-{% if reachable_node_function or reachable_node_reference_function or |
+{% if reachable_node_function or |
set_wrapper_reference_to_list %} |
void {{v8_class}}::visitDOMWrapper(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) |
{ |
@@ -696,14 +696,12 @@ void {{v8_class}}::visitDOMWrapper(void* object, const v8::Persistent<v8::Object |
{% endfor %} |
{% endif %} |
{% if reachable_node_function %} |
- if (Node* owner = impl->{{reachable_node_function}}()) { |
+ // The {{reachable_node_function}}() method may return a reference or a pointer. |
+ if (Node* owner = WTF::getPtr(impl->{{reachable_node_function}}())) { |
Node* root = V8GCController::opaqueRootForGC(owner, isolate); |
isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(root)), wrapper); |
return; |
} |
- {% elif reachable_node_reference_function %} |
- Node* root = V8GCController::opaqueRootForGC(&impl->{{reachable_node_reference_function}}(), isolate); |
- isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(root)), wrapper); |
{% endif %} |
{% if reachable_node_function or set_wrapper_reference_to_list %} |
Nils Barth (inactive)
2014/02/28 02:18:16
This conditional is no longer necessary; I'll fix
Nils Barth (inactive)
2014/03/03 01:58:30
Fixed in:
Cleanup [SetWrapperReferenceFromReferenc
|
setObjectGroup(object, wrapper, isolate); |