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

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 140653013: Have DOMImplementation::document() return reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed StyleSheetList::document changes Created 6 years, 10 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
« no previous file with comments | « Source/bindings/IDLExtendedAttributes.txt ('k') | Source/bindings/tests/idls/TestInterfacePython4.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.pm
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index c1b92a04da6809022d4c0aa83fd25911c51967f3..37ebfd89ba456c2d3f3210aef17bb1b5f5c94bf9 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -513,7 +513,7 @@ sub HeaderFilesForInterface
sub NeedsVisitDOMWrapper
{
my $interface = shift;
- return ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "VisitDOMWrapper") || $interface->extendedAttributes->{"SetWrapperReferenceFrom"} || $interface->extendedAttributes->{"SetWrapperReferenceTo"} || SVGTypeNeedsToHoldContextElement($interface->name);
+ return ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "VisitDOMWrapper") || $interface->extendedAttributes->{"SetWrapperReferenceFrom"} || $interface->extendedAttributes->{"SetWrapperReferenceFromReference"} || $interface->extendedAttributes->{"SetWrapperReferenceTo"} || SVGTypeNeedsToHoldContextElement($interface->name);
}
sub GenerateVisitDOMWrapper
@@ -573,23 +573,37 @@ END
}
my $isReachableMethod = $interface->extendedAttributes->{"SetWrapperReferenceFrom"};
- if ($isReachableMethod) {
+ my $isReachableReferenceMethod = $interface->extendedAttributes->{"SetWrapperReferenceFromReference"};
+
+ if ($isReachableMethod || $isReachableReferenceMethod) {
AddToImplIncludes("bindings/v8/V8GCController.h");
AddToImplIncludes("core/dom/Element.h");
- $code .= <<END;
+ if ($isReachableMethod) {
+ $code .= <<END;
if (Node* owner = impl->${isReachableMethod}()) {
Node* root = V8GCController::opaqueRootForGC(owner, isolate);
isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(root)), wrapper);
return;
}
END
+ } else {
+ $code .= <<END;
+ Node* root = V8GCController::opaqueRootForGC(&impl->${isReachableReferenceMethod}(), isolate);
+ isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(root)), wrapper);
+}
+
+END
+ }
}
- $code .= <<END;
+ if (!$isReachableReferenceMethod) {
+ $code .= <<END;
setObjectGroup(object, wrapper, isolate);
}
END
+ }
+
$implementation{nameSpaceWebCore}->add($code);
}
« no previous file with comments | « Source/bindings/IDLExtendedAttributes.txt ('k') | Source/bindings/tests/idls/TestInterfacePython4.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698