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

Side by Side 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 throwNotEnoughArgumentsError(args.GetIsolate()); 2651 throwNotEnoughArgumentsError(args.GetIsolate());
2652 return; 2652 return;
2653 } 2653 }
2654 2654
2655 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); 2655 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]);
2656 ${implClassName}Init eventInit; 2656 ${implClassName}Init eventInit;
2657 if (args.Length() >= 2) { 2657 if (args.Length() >= 2) {
2658 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate ())); 2658 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate ()));
2659 if (!fill${implClassName}Init(eventInit, options)) 2659 if (!fill${implClassName}Init(eventInit, options))
2660 return; 2660 return;
2661 END
2662 for (my $index = 0; $index < @{$interface->attributes}; $index++) {
2663 my $attribute = @{$interface->attributes}[$index];
2664 if ($attribute->type eq "any") {
2665 my $attributeName = $attribute->name;
2666 $implementation{nameSpaceInternal}->add(<<END);
2667 v8::Local<v8::Value> ${attributeName};
2668 options.get("${attributeName}", ${attributeName});
2669 if (!${attributeName}.IsEmpty())
2670 args.Holder()->SetHiddenValue(V8HiddenPropertyName::${attributeName} (), ${attributeName});
2671 END
2672 }
2673 }
2674 $implementation{nameSpaceInternal}->add(<<END);
2661 } 2675 }
2662 2676
2663 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit); 2677 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit);
2664 2678
2665 v8::Handle<v8::Object> wrapper = args.Holder(); 2679 v8::Handle<v8::Object> wrapper = args.Holder();
2666 V8DOMWrapper::associateObjectWithWrapper(event.release(), &${v8ClassName}::i nfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); 2680 V8DOMWrapper::associateObjectWithWrapper(event.release(), &${v8ClassName}::i nfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
2667 args.GetReturnValue().Set(wrapper); 2681 v8SetReturnValue(args, wrapper);
2668 } 2682 }
2669 END 2683 END
2670 2684
2671 my $code = ""; 2685 my $code = "";
2672 $code .= <<END; 2686 $code .= <<END;
2673 bool fill${implClassName}Init(${implClassName}Init& eventInit, const Dictionary& options) 2687 bool fill${implClassName}Init(${implClassName}Init& eventInit, const Dictionary& options)
2674 { 2688 {
2675 END 2689 END
2676 2690
2677 if ($interface->parent) { 2691 if ($interface->parent) {
2678 my $interfaceBase = $interface->parent; 2692 my $interfaceBase = $interface->parent;
2679 $code .= <<END; 2693 $code .= <<END;
2680 if (!fill${interfaceBase}Init(eventInit, options)) 2694 if (!fill${interfaceBase}Init(eventInit, options))
2681 return false; 2695 return false;
2682 2696
2683 END 2697 END
2684 } 2698 }
2685 2699
2686 for (my $index = 0; $index < @{$interface->attributes}; $index++) { 2700 for (my $index = 0; $index < @{$interface->attributes}; $index++) {
2687 my $attribute = @{$interface->attributes}[$index]; 2701 my $attribute = @{$interface->attributes}[$index];
2688 if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) { 2702 if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) {
2689 my $attributeName = $attribute->name; 2703 my $attributeName = $attribute->name;
2690 $code .= " options.get(\"$attributeName\", eventInit.$attributeNa me);\n"; 2704 my $attributeType = $attribute->type;
2705 if (not ($attribute->type eq "any")) {
2706 $code .= " options.get(\"$attributeName\", eventInit.$attribu teName);\n";
2707 }
2691 } 2708 }
2692 } 2709 }
2693 2710
2694 $code .= <<END; 2711 $code .= <<END;
2695 return true; 2712 return true;
2696 } 2713 }
2697 2714
2698 END 2715 END
2699 $implementation{nameSpaceWebCore}->add($code); 2716 $implementation{nameSpaceWebCore}->add($code);
2700 } 2717 }
(...skipping 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after
6027 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6044 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6028 $found = 1; 6045 $found = 1;
6029 } 6046 }
6030 return 1 if $found; 6047 return 1 if $found;
6031 }, 0); 6048 }, 0);
6032 6049
6033 return $found; 6050 return $found;
6034 } 6051 }
6035 6052
6036 1; 6053 1;
OLDNEW
« 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