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

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

Issue 14670022: Make sure the main header is not included twice in the generated implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@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
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestObj.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 4018 matching lines...) Expand 10 before | Expand all | Expand 10 after
4029 4029
4030 push(@headerContentHeader, "\n#ifndef ${v8InterfaceName}" . "_h\n"); 4030 push(@headerContentHeader, "\n#ifndef ${v8InterfaceName}" . "_h\n");
4031 push(@headerContentHeader, "#define ${v8InterfaceName}" . "_h\n\n"); 4031 push(@headerContentHeader, "#define ${v8InterfaceName}" . "_h\n\n");
4032 push(@headerContentHeader, "#if ${conditionalString}\n") if $conditionalStri ng; 4032 push(@headerContentHeader, "#if ${conditionalString}\n") if $conditionalStri ng;
4033 return join "", @headerContentHeader; 4033 return join "", @headerContentHeader;
4034 } 4034 }
4035 4035
4036 sub GenerateImplementationContentHeader 4036 sub GenerateImplementationContentHeader
4037 { 4037 {
4038 my $interface = shift; 4038 my $interface = shift;
4039 my $v8InterfaceName = "V8" . $interface->name;
4040 my $conditionalString = GenerateConditionalString($interface); 4039 my $conditionalString = GenerateConditionalString($interface);
4041 4040
4042 my @implContentHeader = split("\r", $headerTemplate); 4041 my @implContentHeader = split("\r", $headerTemplate);
4043 4042
4044 push(@implContentHeader, "\n#include \"config.h\"\n"); 4043 push(@implContentHeader, "\n#include \"config.h\"\n");
4045 push(@implContentHeader, "#if ${conditionalString}\n") if $conditionalString ; 4044 push(@implContentHeader, "#if ${conditionalString}\n") if $conditionalString ;
4046 push(@implContentHeader, "#include \"${v8InterfaceName}.h\"\n\n");
4047 return @implContentHeader; 4045 return @implContentHeader;
4048 } 4046 }
4049 4047
4050 sub GenerateCallbackHeader 4048 sub GenerateCallbackHeader
4051 { 4049 {
4052 my $object = shift; 4050 my $object = shift;
4053 my $interface = shift; 4051 my $interface = shift;
4054 4052
4055 my $interfaceName = $interface->name; 4053 my $interfaceName = $interface->name;
4056 my $v8InterfaceName = "V8$interfaceName"; 4054 my $v8InterfaceName = "V8$interfaceName";
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
5092 foreach my $condition (sort keys %implIncludeConditions) { 5090 foreach my $condition (sort keys %implIncludeConditions) {
5093 $implementation{includes}->add("\n#if " . GenerateConditionalStringF romAttributeValue($condition) . "\n"); 5091 $implementation{includes}->add("\n#if " . GenerateConditionalStringF romAttributeValue($condition) . "\n");
5094 foreach my $include (sort @{$implIncludeConditions{$condition}}) { 5092 foreach my $include (sort @{$implIncludeConditions{$condition}}) {
5095 $implementation{includes}->add("#include $include\n"); 5093 $implementation{includes}->add("#include $include\n");
5096 } 5094 }
5097 $implementation{includes}->add("#endif\n"); 5095 $implementation{includes}->add("#endif\n");
5098 } 5096 }
5099 UpdateFile($implFileName, $implementation{root}->toString()); 5097 UpdateFile($implFileName, $implementation{root}->toString());
5100 } else { 5098 } else {
5101 my $contents = join "", @implContentHeader; 5099 my $contents = join "", @implContentHeader;
5100 my $mainInclude = "\"V8$name.h\"";
5101 $contents .= "#include $mainInclude\n\n";
5102 5102
5103 foreach my $include (sort @includes) { 5103 foreach my $include (sort @includes) {
5104 $contents .= "#include $include\n"; 5104 $contents .= "#include $include\n" unless $include eq $mainInclude;
5105 } 5105 }
5106 foreach my $condition (sort keys %implIncludeConditions) { 5106 foreach my $condition (sort keys %implIncludeConditions) {
5107 $contents .= "\n#if " . GenerateConditionalStringFromAttributeValue( $condition) . "\n"; 5107 $contents .= "\n#if " . GenerateConditionalStringFromAttributeValue( $condition) . "\n";
5108 foreach my $include (sort @{$implIncludeConditions{$condition}}) { 5108 foreach my $include (sort @{$implIncludeConditions{$condition}}) {
5109 $contents .= "#include $include\n"; 5109 $contents .= "#include $include\n";
5110 } 5110 }
5111 $contents .= "#endif\n"; 5111 $contents .= "#endif\n";
5112 } 5112 }
5113 5113
5114 $contents .= "\n"; 5114 $contents .= "\n";
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
5691 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 5691 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
5692 $found = 1; 5692 $found = 1;
5693 } 5693 }
5694 return 1 if $found; 5694 return 1 if $found;
5695 }, 0); 5695 }, 0);
5696 5696
5697 return $found; 5697 return $found;
5698 } 5698 }
5699 5699
5700 1; 5700 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestObj.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698