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

Side by Side Diff: Source/bindings/scripts/deprecated_code_generator_v8.pm

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Constructor. Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/IDLAttributes.txt ('k') | Source/bindings/v8/V8ErrorHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 } 2609 }
2610 } 2610 }
2611 2611
2612 sub GenerateEventConstructor 2612 sub GenerateEventConstructor
2613 { 2613 {
2614 my $interface = shift; 2614 my $interface = shift;
2615 my $implClassName = GetImplName($interface); 2615 my $implClassName = GetImplName($interface);
2616 my $v8ClassName = GetV8ClassName($interface); 2616 my $v8ClassName = GetV8ClassName($interface);
2617 2617
2618 my @anyAttributeNames; 2618 my @anyAttributeNames;
2619 my @serializableAnyAttributeNames;
2619 foreach my $attribute (@{$interface->attributes}) { 2620 foreach my $attribute (@{$interface->attributes}) {
2620 if ($attribute->type eq "any") { 2621 if ($attribute->type eq "any") {
2621 push(@anyAttributeNames, $attribute->name); 2622 push(@anyAttributeNames, $attribute->name);
2623 if (!$attribute->extendedAttributes->{"Unserializable"}) {
2624 push(@serializableAnyAttributeNames, $attribute->name);
2625 }
2622 } 2626 }
2623 } 2627 }
2624 2628
2625 AddToImplIncludes("bindings/v8/Dictionary.h"); 2629 AddToImplIncludes("bindings/v8/Dictionary.h");
2626 $implementation{nameSpaceInternal}->add(<<END); 2630 $implementation{nameSpaceInternal}->add(<<END);
2627 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) 2631 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
2628 { 2632 {
2629 if (args.Length() < 1) { 2633 if (args.Length() < 1) {
2630 throwNotEnoughArgumentsError(args.GetIsolate()); 2634 throwNotEnoughArgumentsError(args.GetIsolate());
2631 return; 2635 return;
(...skipping 22 matching lines...) Expand all
2654 args.Holder()->SetHiddenValue(V8HiddenPropertyName::${attrName}(), $ {attrName}); 2658 args.Holder()->SetHiddenValue(V8HiddenPropertyName::${attrName}(), $ {attrName});
2655 END 2659 END
2656 } 2660 }
2657 2661
2658 $implementation{nameSpaceInternal}->add(<<END); 2662 $implementation{nameSpaceInternal}->add(<<END);
2659 } 2663 }
2660 2664
2661 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit); 2665 RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit);
2662 END 2666 END
2663 2667
2664 if (@anyAttributeNames) { 2668 if (@serializableAnyAttributeNames) {
2665 # If we're in an isolated world, create a SerializedScriptValue and stor e it in the event for 2669 # If we're in an isolated world, create a SerializedScriptValue and stor e it in the event for
2666 # later cloning if the property is accessed from another world. 2670 # later cloning if the property is accessed from another world.
2667 # The main world case is handled lazily (in Custom code). 2671 # The main world case is handled lazily (in Custom code).
2668 $implementation{nameSpaceInternal}->add(" if (isolatedWorldForIsolate (args.GetIsolate())) {\n"); 2672 $implementation{nameSpaceInternal}->add(" if (isolatedWorldForIsolate (args.GetIsolate())) {\n");
2669 foreach my $attrName (@anyAttributeNames) { 2673 foreach my $attrName (@serializableAnyAttributeNames) {
2670 my $setter = "setSerialized" . FirstLetterToUpperCase($attrName); 2674 my $setter = "setSerialized" . FirstLetterToUpperCase($attrName);
2671 $implementation{nameSpaceInternal}->add(<<END); 2675 $implementation{nameSpaceInternal}->add(<<END);
2672 if (!${attrName}.IsEmpty()) 2676 if (!${attrName}.IsEmpty())
2673 event->${setter}(SerializedScriptValue::createAndSwallowExceptions($ {attrName}, args.GetIsolate())); 2677 event->${setter}(SerializedScriptValue::createAndSwallowExceptions($ {attrName}, args.GetIsolate()));
2674 END 2678 END
2675 } 2679 }
2676 $implementation{nameSpaceInternal}->add(" }\n\n"); 2680 $implementation{nameSpaceInternal}->add(" }\n\n");
2677 } 2681 }
2678 2682
2679 $implementation{nameSpaceInternal}->add(<<END); 2683 $implementation{nameSpaceInternal}->add(<<END);
(...skipping 3336 matching lines...) Expand 10 before | Expand all | Expand 10 after
6016 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6020 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6017 $found = 1; 6021 $found = 1;
6018 } 6022 }
6019 return 1 if $found; 6023 return 1 if $found;
6020 }, 0); 6024 }, 0);
6021 6025
6022 return $found; 6026 return $found;
6023 } 6027 }
6024 6028
6025 1; 6029 1;
OLDNEW
« no previous file with comments | « Source/bindings/scripts/IDLAttributes.txt ('k') | Source/bindings/v8/V8ErrorHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698