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

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

Issue 27003002: IDL compiler: [Reflect] for getters (+ remove unnecessary WebCore::) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 7 years, 2 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 | « no previous file | Source/bindings/scripts/unstable/v8_attributes.py » ('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 6035 matching lines...) Expand 10 before | Expand all | Expand 10 after
6046 6046
6047 my $contentAttributeName = $attribute->extendedAttributes->{"Reflect"}; 6047 my $contentAttributeName = $attribute->extendedAttributes->{"Reflect"};
6048 return undef if !$contentAttributeName; 6048 return undef if !$contentAttributeName;
6049 6049
6050 $contentAttributeName = lc AttributeNameForGetterAndSetter($attribute) if $c ontentAttributeName eq "VALUE_IS_MISSING"; 6050 $contentAttributeName = lc AttributeNameForGetterAndSetter($attribute) if $c ontentAttributeName eq "VALUE_IS_MISSING";
6051 6051
6052 my $namespace = NamespaceForAttributeName($interfaceName, $contentAttributeN ame); 6052 my $namespace = NamespaceForAttributeName($interfaceName, $contentAttributeN ame);
6053 6053
6054 AddToImplIncludes("${namespace}.h"); 6054 AddToImplIncludes("${namespace}.h");
6055 # Attr (not Attribute) used in core content attributes 6055 # Attr (not Attribute) used in core content attributes
6056 return "WebCore::${namespace}::${contentAttributeName}Attr"; 6056 return "${namespace}::${contentAttributeName}Attr";
6057 } 6057 }
6058 6058
6059 sub GetterExpression 6059 sub GetterExpression
6060 { 6060 {
6061 my ($interfaceName, $attribute) = @_; 6061 my ($interfaceName, $attribute) = @_;
6062 6062
6063 my $contentAttributeName = ContentAttributeName($interfaceName, $attribute); 6063 my $contentAttributeName = ContentAttributeName($interfaceName, $attribute);
6064 6064
6065 if (!$contentAttributeName) { 6065 if (!$contentAttributeName) {
6066 return (ToMethodName(AttributeNameForGetterAndSetter($attribute))); 6066 return (ToMethodName(AttributeNameForGetterAndSetter($attribute)));
6067 } 6067 }
6068 6068
6069 my $functionName; 6069 my $functionName;
6070 if ($attribute->extendedAttributes->{"URL"}) { 6070 if ($attribute->extendedAttributes->{"URL"}) {
6071 $functionName = "getURLAttribute"; 6071 $functionName = "getURLAttribute";
6072 } elsif ($attribute->type eq "boolean") { 6072 } elsif ($attribute->type eq "boolean") {
6073 $functionName = "fastHasAttribute"; 6073 $functionName = "fastHasAttribute";
6074 } elsif ($attribute->type eq "long") { 6074 } elsif ($attribute->type eq "long") {
6075 $functionName = "getIntegralAttribute"; 6075 $functionName = "getIntegralAttribute";
6076 } elsif ($attribute->type eq "unsigned long") { 6076 } elsif ($attribute->type eq "unsigned long") {
6077 $functionName = "getUnsignedIntegralAttribute"; 6077 $functionName = "getUnsignedIntegralAttribute";
6078 } else { 6078 } else {
6079 if ($contentAttributeName eq "WebCore::HTMLNames::idAttr") { 6079 if ($contentAttributeName eq "HTMLNames::idAttr") {
6080 $functionName = "getIdAttribute"; 6080 $functionName = "getIdAttribute";
6081 $contentAttributeName = ""; 6081 $contentAttributeName = "";
6082 } elsif ($contentAttributeName eq "WebCore::HTMLNames::nameAttr") { 6082 } elsif ($contentAttributeName eq "HTMLNames::nameAttr") {
6083 $functionName = "getNameAttribute"; 6083 $functionName = "getNameAttribute";
6084 $contentAttributeName = ""; 6084 $contentAttributeName = "";
6085 } elsif ($contentAttributeName eq "WebCore::HTMLNames::classAttr") { 6085 } elsif ($contentAttributeName eq "HTMLNames::classAttr") {
6086 $functionName = "getClassAttribute"; 6086 $functionName = "getClassAttribute";
6087 $contentAttributeName = ""; 6087 $contentAttributeName = "";
6088 } else { 6088 } else {
6089 # We cannot use fast attributes for animated SVG types. 6089 # We cannot use fast attributes for animated SVG types.
6090 $functionName = IsSVGAnimatedType($attribute->type) ? "getAttribute" : "fastGetAttribute"; 6090 $functionName = IsSVGAnimatedType($attribute->type) ? "getAttribute" : "fastGetAttribute";
6091 } 6091 }
6092 } 6092 }
6093 6093
6094 return ($functionName, $contentAttributeName); 6094 return ($functionName, $contentAttributeName);
6095 } 6095 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
6219 my $interface = shift; 6219 my $interface = shift;
6220 6220
6221 return 1 if $interface->extendedAttributes->{"CustomToV8"}; 6221 return 1 if $interface->extendedAttributes->{"CustomToV8"};
6222 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6222 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6223 return 1 if InheritsInterface($interface, "Document"); 6223 return 1 if InheritsInterface($interface, "Document");
6224 6224
6225 return 0; 6225 return 0;
6226 } 6226 }
6227 6227
6228 1; 6228 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_attributes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698