Title: [105714] trunk/Source/WebCore
- Revision
- 105714
- Author
- [email protected]
- Date
- 2012-01-24 02:32:48 -0800 (Tue, 24 Jan 2012)
Log Message
[Refactoring] Makes finish() of CodeGeneratorV8.pm empty
https://bugs.webkit.org/show_bug.cgi?id=76841
Reviewed by Adam Barth.
This is one of steps to stop rebuilding .h/.cpp files
generated by unchanged IDLs (bug 76836).
As refactoring, we are planning to remove finish() from
all CodeGenerators. This patch makes finish() of
CodeGeneratorV8.pm empty.
No new tests. No change in behavior.
* bindings/scripts/CodeGeneratorV8.pm:
(finish): Made it empty. We will remove finish() after
making finish() of all CodeGenerators empty.
(GenerateInterface): Modified to call WriteData().
(WriteData): Simple code refactoring.
Removed if(defined $IMPL).
Removed if(defined $HEADER).
$IMPL -> IMPL.
$HEADER -> HEADER.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (105713 => 105714)
--- trunk/Source/WebCore/ChangeLog 2012-01-24 10:17:02 UTC (rev 105713)
+++ trunk/Source/WebCore/ChangeLog 2012-01-24 10:32:48 UTC (rev 105714)
@@ -1,3 +1,29 @@
+2012-01-24 Kentaro Hara <[email protected]>
+
+ [Refactoring] Makes finish() of CodeGeneratorV8.pm empty
+ https://bugs.webkit.org/show_bug.cgi?id=76841
+
+ Reviewed by Adam Barth.
+
+ This is one of steps to stop rebuilding .h/.cpp files
+ generated by unchanged IDLs (bug 76836).
+
+ As refactoring, we are planning to remove finish() from
+ all CodeGenerators. This patch makes finish() of
+ CodeGeneratorV8.pm empty.
+
+ No new tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (finish): Made it empty. We will remove finish() after
+ making finish() of all CodeGenerators empty.
+ (GenerateInterface): Modified to call WriteData().
+ (WriteData): Simple code refactoring.
+ Removed if(defined $IMPL).
+ Removed if(defined $HEADER).
+ $IMPL -> IMPL.
+ $HEADER -> HEADER.
+
2012-01-24 Mario Sanchez Prada <[email protected]>
Unreviewed build fix for GTK after r105698.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (105713 => 105714)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-01-24 10:17:02 UTC (rev 105713)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-01-24 10:32:48 UTC (rev 105714)
@@ -32,7 +32,7 @@
use constant FileNamePrefix => "V8";
-my ($codeGenerator, $IMPL, $HEADER);
+my ($codeGenerator);
my $module = "";
my $outputDir = "";
@@ -85,12 +85,10 @@
return $reference;
}
+# FIXME(haraken): finish() will be soon removed from all CodeGenerators.
sub finish
{
my $object = shift;
-
- # Commit changes!
- $object->WriteData();
}
# Params: 'domClass' struct
@@ -109,15 +107,7 @@
$object->GenerateImplementation($dataNode);
}
- my $name = $dataNode->name;
-
- # Open files for writing
- my $prefix = FileNamePrefix;
- my $headerFileName = "$outputHeadersDir/$prefix$name.h";
- my $implFileName = "$outputDir/$prefix$name.cpp";
-
- open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
- open($HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
+ $object->WriteData($dataNode);
}
# Params: 'idlDocument' struct
@@ -3807,63 +3797,67 @@
# Internal helper
sub WriteData
{
- if (defined($IMPL)) {
- # Write content to file.
- print $IMPL @implContentHeader;
+ my $object = shift;
+ my $dataNode = shift;
- print $IMPL @implFixedHeader;
+ my $name = $dataNode->name;
+ my $prefix = FileNamePrefix;
+ my $headerFileName = "$outputHeadersDir/$prefix$name.h";
+ my $implFileName = "$outputDir/$prefix$name.cpp";
- my @includes = ();
- my %implIncludeConditions = ();
- foreach my $include (keys %implIncludes) {
- my $condition = $implIncludes{$include};
- my $checkType = $include;
- $checkType =~ s/\.h//;
- next if $codeGenerator->IsSVGAnimatedType($checkType);
+ open(IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
- if ($include =~ /wtf/) {
- $include = "\<$include\>";
- } else {
- $include = "\"$include\"";
- }
+ # Write content to file.
+ print IMPL @implContentHeader;
+ print IMPL @implFixedHeader;
- if ($condition eq 1) {
- push @includes, $include;
- } else {
- push @{$implIncludeConditions{$condition}}, $include;
- }
+ my @includes = ();
+ my %implIncludeConditions = ();
+ foreach my $include (keys %implIncludes) {
+ my $condition = $implIncludes{$include};
+ my $checkType = $include;
+ $checkType =~ s/\.h//;
+ next if $codeGenerator->IsSVGAnimatedType($checkType);
+
+ if ($include =~ /wtf/) {
+ $include = "\<$include\>";
+ } else {
+ $include = "\"$include\"";
}
- foreach my $include (sort @includes) {
- print $IMPL "#include $include\n";
+
+ if ($condition eq 1) {
+ push @includes, $include;
+ } else {
+ push @{$implIncludeConditions{$condition}}, $include;
}
- foreach my $condition (sort keys %implIncludeConditions) {
- print $IMPL "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n";
- foreach my $include (sort @{$implIncludeConditions{$condition}}) {
- print $IMPL "#include $include\n";
- }
- print $IMPL "#endif\n";
+ }
+ foreach my $include (sort @includes) {
+ print IMPL "#include $include\n";
+ }
+ foreach my $condition (sort keys %implIncludeConditions) {
+ print IMPL "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n";
+ foreach my $include (sort @{$implIncludeConditions{$condition}}) {
+ print IMPL "#include $include\n";
}
+ print IMPL "#endif\n";
+ }
- print $IMPL "\n";
- print $IMPL @implContentDecls;
- print $IMPL @implContent;
- close($IMPL);
- undef($IMPL);
+ print IMPL "\n";
+ print IMPL @implContentDecls;
+ print IMPL @implContent;
+ close(IMPL);
- %implIncludes = ();
- @implFixedHeader = ();
- @implContentDecls = ();
- @implContent = ();
- }
+ %implIncludes = ();
+ @implFixedHeader = ();
+ @implContentDecls = ();
+ @implContent = ();
- if (defined($HEADER)) {
- # Write content to file.
- print $HEADER @headerContent;
- close($HEADER);
- undef($HEADER);
+ # Write content to file.
+ open(HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
+ print HEADER @headerContent;
+ close(HEADER);
- @headerContent = ();
- }
+ @headerContent = ();
}
sub GetVisibleInterfaceName
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes