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

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

Issue 15540004: Auto-generate HTMLFrameSetElement::namedPropertyGetter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3419 ASSERT(impl); 3419 ASSERT(impl);
3420 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate); 3420 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate);
3421 if (!wrapper.IsEmpty()) 3421 if (!wrapper.IsEmpty())
3422 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $v iewType, impl->length()); 3422 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $v iewType, impl->length());
3423 return wrapper; 3423 return wrapper;
3424 } 3424 }
3425 3425
3426 END 3426 END
3427 } 3427 }
3428 3428
3429 my $indexer;
kojih 2013/05/21 07:35:12 remeoved unused variable.
3430 my @enabledPerContextFunctions; 3429 my @enabledPerContextFunctions;
3431 my @normalFunctions; 3430 my @normalFunctions;
3432 my $needsDomainSafeFunctionSetter = 0; 3431 my $needsDomainSafeFunctionSetter = 0;
3433 # Generate methods for functions. 3432 # Generate methods for functions.
3434 foreach my $function (@{$interface->functions}) { 3433 foreach my $function (@{$interface->functions}) {
3434 next if $function->signature->name eq "";
kojih 2013/05/21 07:35:12 To prevent anonymous getter function from being ad
3435 GenerateFunction($function, $interface, ""); 3435 GenerateFunction($function, $interface, "");
3436 if ($function->signature->extendedAttributes->{"PerWorldBindings"}) { 3436 if ($function->signature->extendedAttributes->{"PerWorldBindings"}) {
3437 GenerateFunction($function, $interface, "ForMainWorld"); 3437 GenerateFunction($function, $interface, "ForMainWorld");
3438 } 3438 }
3439 if ($function->{overloadIndex} == @{$function->{overloads}}) { 3439 if ($function->{overloadIndex} == @{$function->{overloads}}) {
3440 if ($function->{overloadIndex} > 1) { 3440 if ($function->{overloadIndex} > 1) {
3441 GenerateOverloadedFunction($function, $interface, ""); 3441 GenerateOverloadedFunction($function, $interface, "");
3442 if ($function->signature->extendedAttributes->{"PerWorldBindings "}) { 3442 if ($function->signature->extendedAttributes->{"PerWorldBindings "}) {
3443 GenerateOverloadedFunction($function, $interface, "ForMainWo rld"); 3443 GenerateOverloadedFunction($function, $interface, "ForMainWo rld");
3444 } 3444 }
3445 } 3445 }
3446 GenerateFunctionCallback($function, $interface, ""); 3446 GenerateFunctionCallback($function, $interface, "");
3447 if ($function->signature->extendedAttributes->{"PerWorldBindings"}) { 3447 if ($function->signature->extendedAttributes->{"PerWorldBindings"}) {
3448 GenerateFunctionCallback($function, $interface, "ForMainWorld"); 3448 GenerateFunctionCallback($function, $interface, "ForMainWorld");
3449 } 3449 }
3450 } 3450 }
3451 3451
3452 if ($function->signature->name eq "item") {
3453 $indexer = $function->signature;
3454 }
3455
3456 # If the function does not need domain security check, we need to 3452 # If the function does not need domain security check, we need to
3457 # generate an access getter that returns different function objects 3453 # generate an access getter that returns different function objects
3458 # for different calling context. 3454 # for different calling context.
3459 if ($interface->extendedAttributes->{"CheckSecurity"} && $function->sign ature->extendedAttributes->{"DoNotCheckSecurity"}) { 3455 if ($interface->extendedAttributes->{"CheckSecurity"} && $function->sign ature->extendedAttributes->{"DoNotCheckSecurity"}) {
3460 if (!HasCustomMethod($function->signature->extendedAttributes) || $f unction->{overloadIndex} == 1) { 3456 if (!HasCustomMethod($function->signature->extendedAttributes) || $f unction->{overloadIndex} == 1) {
3461 GenerateDomainSafeFunctionGetter($function, $interface); 3457 GenerateDomainSafeFunctionGetter($function, $interface);
3462 $needsDomainSafeFunctionSetter = 1; 3458 $needsDomainSafeFunctionSetter = 1;
3463 } 3459 }
3464 } 3460 }
3465 3461
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 return 1; 4613 return 1;
4618 } 4614 }
4619 } 4615 }
4620 return 0; 4616 return 0;
4621 } 4617 }
4622 4618
4623 sub IsUnionType 4619 sub IsUnionType
4624 { 4620 {
4625 my $type = shift; # string or UnionType 4621 my $type = shift; # string or UnionType
4626 if(ref($type) eq "UnionType") { 4622 if(ref($type) eq "UnionType") {
4627 die "Currently only 2 values of non-union type is supported as union typ e.\n" unless @{$type->unionMemberTypes} == 2;
kojih 2013/05/21 07:35:12 # of union members is not limited by 2. http://src
4628 return 1; 4623 return 1;
4629 } 4624 }
4630 return 0; 4625 return 0;
4631 } 4626 }
4632 4627
4633 sub IsWrapperType 4628 sub IsWrapperType
4634 { 4629 {
4635 my $type = shift; 4630 my $type = shift;
4636 return 0 if GetArrayType($type); 4631 return 0 if GetArrayType($type);
4637 return 0 if GetSequenceType($type); 4632 return 0 if GetSequenceType($type);
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 5385 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
5391 $found = 1; 5386 $found = 1;
5392 } 5387 }
5393 return 1 if $found; 5388 return 1 if $found;
5394 }, 0); 5389 }, 0);
5395 5390
5396 return $found; 5391 return $found;
5397 } 5392 }
5398 5393
5399 1; 5394 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698