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

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

Issue 23532053: [abandoned] IDL attribute "SetHiddenValueTo" to build strong refs to wrapped object's dependen… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/scripts/deprecated_code_generator_v8.pm
diff --git a/Source/bindings/scripts/deprecated_code_generator_v8.pm b/Source/bindings/scripts/deprecated_code_generator_v8.pm
index a96f3b6f7e6162c7e5c45feb4cd84bc2ea9a3ebb..fc475ef29ef074251ec28539829ae7d95e0c873e 100644
--- a/Source/bindings/scripts/deprecated_code_generator_v8.pm
+++ b/Source/bindings/scripts/deprecated_code_generator_v8.pm
@@ -819,7 +819,8 @@ public:
};
END
- my $customWrap = $interface->extendedAttributes->{"CustomToV8"};
+ my $setHiddenValue = $interface->extendedAttributes->{"SetHiddenValueTo"};
+ my $customWrap = $interface->extendedAttributes->{"CustomToV8"} || $setHiddenValue;
if ($noToV8) {
die "Can't suppress toV8 for subclass\n" if $interface->parent;
} elsif ($noWrap) {
@@ -4002,6 +4003,30 @@ v8::Handle<v8::Object> wrap($implClassName* impl, v8::Handle<v8::Object> creatio
END
}
+ my $setHiddenValue = $interface->extendedAttributes->{"SetHiddenValueTo"};
+ if ($setHiddenValue) {
+ my @hiddenValues = split /\s*\|\s*/, $setHiddenValue;
+
kouhei (in TOK) 2013/09/10 01:30:34 I think we need to addIncludesForType(<$setHiddenV
Nils Barth (inactive) 2013/09/10 01:50:55 Discussed offline; issue is that required include
+ $implementation{nameSpaceWebCore}->add(<<END);
+v8::Handle<v8::Object> wrap($implClassName* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ ASSERT(impl);
+ v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creationContext, isolate);
+END
+ foreach my $hiddenValue (@hiddenValues) {
+ $implementation{nameSpaceWebCore}->add(<<END);
+ if (impl->$hiddenValue())
+ V8HiddenPropertyName::setNamedHiddenReference(wrapper, "$hiddenValue", toV8(impl->$hiddenValue(), creationContext, isolate));
+END
+ }
+
+ $implementation{nameSpaceWebCore}->add(<<END);
+ return wrapper;
+}
+
+END
+ }
+
my @enabledPerContextFunctions;
my @normalFunctions;
my $needsDomainSafeFunctionSetter = 0;

Powered by Google App Engine
This is Rietveld 408576698