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

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

Issue 17063016: Remove leak of objects between isolated worlds on custom events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minor rebase nits. Created 7 years, 5 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/CodeGeneratorV8.pm
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
index 0e3b0fc2686f449437091aa2f483aadd82eeb1ae..1300e8490640c7812638572b2e0a2ae88a6d6696 100644
--- a/Source/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm
@@ -2658,13 +2658,27 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate()));
if (!fill${implClassName}Init(eventInit, options))
return;
+END
+ for (my $index = 0; $index < @{$interface->attributes}; $index++) {
+ my $attribute = @{$interface->attributes}[$index];
+ if ($attribute->type eq "any") {
+ my $attributeName = $attribute->name;
+ $implementation{nameSpaceInternal}->add(<<END);
+ v8::Local<v8::Value> ${attributeName};
+ options.get("${attributeName}", ${attributeName});
+ if (!${attributeName}.IsEmpty())
+ args.Holder()->SetHiddenValue(V8HiddenPropertyName::${attributeName}(), ${attributeName});
+END
+ }
+ }
+ $implementation{nameSpaceInternal}->add(<<END);
}
RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit);
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::associateObjectWithWrapper(event.release(), &${v8ClassName}::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
- args.GetReturnValue().Set(wrapper);
+ v8SetReturnValue(args, wrapper);
}
END
@@ -2687,7 +2701,10 @@ END
my $attribute = @{$interface->attributes}[$index];
if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) {
my $attributeName = $attribute->name;
- $code .= " options.get(\"$attributeName\", eventInit.$attributeName);\n";
+ my $attributeType = $attribute->type;
+ if (not ($attribute->type eq "any")) {
+ $code .= " options.get(\"$attributeName\", eventInit.$attributeName);\n";
+ }
}
}
« no previous file with comments | « LayoutTests/fast/events/event-properties-gc-expected.txt ('k') | Source/bindings/tests/results/V8TestEventConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698