Title: [105683] trunk/Source/WebCore
- Revision
- 105683
- Author
- [email protected]
- Date
- 2012-01-23 19:59:55 -0800 (Mon, 23 Jan 2012)
Log Message
[Refactoring] Make finish() of CodeGeneratorJS.pm empty
https://bugs.webkit.org/show_bug.cgi?id=76846
Reviewed by Adam Barth.
This is one of steps to stop rebuilding .h/.cpp files generated
by unchanged IDLs (bug 76836).
As a refactoring, we are planning to remove finish() from all
CodeGenerators. In this bug, we make finish() of CodeGeneratorJS.pm
empty.
No new tests. No change in behavior.
* bindings/scripts/CodeGeneratorJS.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).
Removed if(defined $DEPS).
$IMPL -> IMPL.
$HEADER -> HEADER.
$DEPS -> DEPS.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (105682 => 105683)
--- trunk/Source/WebCore/ChangeLog 2012-01-24 03:55:17 UTC (rev 105682)
+++ trunk/Source/WebCore/ChangeLog 2012-01-24 03:59:55 UTC (rev 105683)
@@ -1,3 +1,31 @@
+2012-01-23 Kentaro Hara <[email protected]>
+
+ [Refactoring] Make finish() of CodeGeneratorJS.pm empty
+ https://bugs.webkit.org/show_bug.cgi?id=76846
+
+ Reviewed by Adam Barth.
+
+ This is one of steps to stop rebuilding .h/.cpp files generated
+ by unchanged IDLs (bug 76836).
+
+ As a refactoring, we are planning to remove finish() from all
+ CodeGenerators. In this bug, we make finish() of CodeGeneratorJS.pm
+ empty.
+
+ No new tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorJS.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).
+ Removed if(defined $DEPS).
+ $IMPL -> IMPL.
+ $HEADER -> HEADER.
+ $DEPS -> DEPS.
+
2012-01-23 Shawn Singh <[email protected]>
[chromium] updateRect is incorrect when contentBounds != bounds
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (105682 => 105683)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-01-24 03:55:17 UTC (rev 105682)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-01-24 03:59:55 UTC (rev 105683)
@@ -30,7 +30,7 @@
use constant FileNamePrefix => "JS";
-my ($codeGenerator, $IMPL, $HEADER, $DEPS);
+my ($codeGenerator);
my $module = "";
my $outputDir = "";
@@ -88,12 +88,10 @@
return $reference;
}
+# FIXME(haraken): finish() will be soon removed from all CodeGenerators.
sub finish
{
my $object = shift;
-
- # Commit changes!
- $object->WriteData();
}
sub leftShift($$) {
@@ -119,22 +117,7 @@
$object->GenerateImplementation($dataNode);
}
- my $name = $dataNode->name;
-
- # Open files for writing
- my $prefix = FileNamePrefix;
- my $headerFileName = "$outputDir/$prefix$name.h";
- my $implFileName = "$outputDir/$prefix$name.cpp";
- my $depsFileName = "$outputDir/$prefix$name.dep";
-
- # Remove old dependency file.
- unlink($depsFileName);
-
- open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
- open($HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
- if (@depsContent) {
- open($DEPS, ">$depsFileName") || die "Couldn't open file $depsFileName";
- }
+ $object->WriteData($dataNode);
}
sub GenerateAttributeEventListenerCall
@@ -3248,84 +3231,94 @@
# Internal helper
sub WriteData
{
- if (defined($IMPL)) {
- # Write content to file.
- print $IMPL @implContentHeader;
+ my $object = shift;
+ my $dataNode = shift;
- my @includes = ();
- my %implIncludeConditions = ();
- foreach my $include (keys %implIncludes) {
- my $condition = $implIncludes{$include};
- my $checkType = $include;
- $checkType =~ s/\.h//;
- next if $codeGenerator->IsSVGAnimatedType($checkType);
+ my $name = $dataNode->name;
+ my $prefix = FileNamePrefix;
+ my $headerFileName = "$outputDir/$prefix$name.h";
+ my $implFileName = "$outputDir/$prefix$name.cpp";
+ my $depsFileName = "$outputDir/$prefix$name.dep";
- $include = "\"$include\"" unless $include =~ /^["<]/; # "
+ # Remove old dependency file.
+ unlink($depsFileName);
- if ($condition eq 1) {
- push @includes, $include;
- } else {
- push @{$implIncludeConditions{$condition}}, $include;
- }
- }
- 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";
- }
+ open(IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
- print $IMPL @implContent;
- close($IMPL);
- undef($IMPL);
+ # Write content to file.
+ print IMPL @implContentHeader;
- @implContentHeader = ();
- @implContent = ();
- %implIncludes = ();
- }
+ 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 (defined($HEADER)) {
- # Write content to file.
- print $HEADER @headerContentHeader;
+ $include = "\"$include\"" unless $include =~ /^["<]/; # "
- my @includes = ();
- foreach my $include (keys %headerIncludes) {
- $include = "\"$include\"" unless $include =~ /^["<]/; # "
+ if ($condition eq 1) {
push @includes, $include;
+ } else {
+ push @{$implIncludeConditions{$condition}}, $include;
}
- foreach my $include (sort @includes) {
- print $HEADER "#include $include\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 $HEADER @headerContent;
+ print IMPL @implContent;
+ close(IMPL);
- @includes = ();
- foreach my $include (keys %headerTrailingIncludes) {
- $include = "\"$include\"" unless $include =~ /^["<]/; # "
- push @includes, $include;
- }
- foreach my $include (sort @includes) {
- print $HEADER "#include $include\n";
- }
+ @implContentHeader = ();
+ @implContent = ();
+ %implIncludes = ();
- close($HEADER);
- undef($HEADER);
+ open(HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
- @headerContentHeader = ();
- @headerContent = ();
- %headerIncludes = ();
- %headerTrailingIncludes = ();
+ # Write content to file.
+ print HEADER @headerContentHeader;
+
+ my @includes = ();
+ foreach my $include (keys %headerIncludes) {
+ $include = "\"$include\"" unless $include =~ /^["<]/; # "
+ push @includes, $include;
}
+ foreach my $include (sort @includes) {
+ print HEADER "#include $include\n";
+ }
- if (defined($DEPS)) {
+ print HEADER @headerContent;
+
+ @includes = ();
+ foreach my $include (keys %headerTrailingIncludes) {
+ $include = "\"$include\"" unless $include =~ /^["<]/; # "
+ push @includes, $include;
+ }
+ foreach my $include (sort @includes) {
+ print HEADER "#include $include\n";
+ }
+
+ close(HEADER);
+
+ @headerContentHeader = ();
+ @headerContent = ();
+ %headerIncludes = ();
+ %headerTrailingIncludes = ();
+
+ if (@depsContent) {
+ open(DEPS, ">$depsFileName") || die "Couldn't open file $depsFileName";
# Write dependency file.
- print $DEPS @depsContent;
- close($DEPS);
- undef($DEPS);
+ print DEPS @depsContent;
+ close(DEPS);
@depsContent = ();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes