Modified: trunk/Source/WebCore/ChangeLog (135231 => 135232)
--- trunk/Source/WebCore/ChangeLog 2012-11-20 02:45:48 UTC (rev 135231)
+++ trunk/Source/WebCore/ChangeLog 2012-11-20 02:58:27 UTC (rev 135232)
@@ -1,5 +1,23 @@
2012-11-19 Kentaro Hara <[email protected]>
+ In CodeGeneratorCPP.pm we should rename $dataNode to $interface
+ https://bugs.webkit.org/show_bug.cgi?id=102752
+
+ Reviewed by Adam Barth.
+
+ $dataNode is misnamed. It should be $interface.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ (GenerateInterface):
+ (GetParentImplClassName):
+ (GetParent):
+ (GenerateHeader):
+ (GenerateImplementation):
+
+2012-11-19 Kentaro Hara <[email protected]>
+
In CodeGeneratorJS.pm we should rename $dataNode to $interface
https://bugs.webkit.org/show_bug.cgi?id=102748
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm (135231 => 135232)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-11-20 02:45:48 UTC (rev 135231)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-11-20 02:58:27 UTC (rev 135232)
@@ -109,16 +109,16 @@
sub GenerateInterface
{
my $object = shift;
- my $dataNode = shift;
+ my $interface = shift;
my $defines = shift;
- my $name = $dataNode->name;
+ my $name = $interface->name;
my $className = GetClassName($name);
- my $parentClassName = "WebDOM" . GetParentImplClassName($dataNode);
+ my $parentClassName = "WebDOM" . GetParentImplClassName($interface);
# Start actual generation.
- $object->GenerateHeader($dataNode);
- $object->GenerateImplementation($dataNode);
+ $object->GenerateHeader($interface);
+ $object->GenerateImplementation($interface);
# Write changes.
$object->WriteData(FileNamePrefix . $name);
@@ -144,30 +144,30 @@
sub GetParentImplClassName
{
- my $dataNode = shift;
+ my $interface = shift;
- if (@{$dataNode->parents} eq 0) {
- return "EventTarget" if $dataNode->extendedAttributes->{"EventTarget"};
+ if (@{$interface->parents} eq 0) {
+ return "EventTarget" if $interface->extendedAttributes->{"EventTarget"};
return "Object";
}
- return $dataNode->parents(0);
+ return $interface->parents(0);
}
sub GetParent
{
- my $dataNode = shift;
- my $numParents = @{$dataNode->parents};
+ my $interface = shift;
+ my $numParents = @{$interface->parents};
my $parent = "";
if ($numParents eq 0) {
$parent = "WebDOMObject";
- $parent = "WebDOMEventTarget" if $dataNode->extendedAttributes->{"EventTarget"};
+ $parent = "WebDOMEventTarget" if $interface->extendedAttributes->{"EventTarget"};
} elsif ($numParents eq 1) {
- my $parentName = $dataNode->parents(0);
+ my $parentName = $interface->parents(0);
$parent = "WebDOM" . $parentName;
} else {
- my @parents = @{$dataNode->parents};
+ my @parents = @{$interface->parents};
my $firstParent = shift(@parents);
$parent = "WebDOM" . $firstParent;
}
@@ -341,27 +341,27 @@
sub GenerateHeader
{
my $object = shift;
- my $dataNode = shift;
+ my $interface = shift;
- my $interfaceName = $dataNode->name;
+ my $interfaceName = $interface->name;
my $className = GetClassName($interfaceName);
my $implClassName = GetImplClassName($interfaceName);
my $implClassNameWithNamespace = GetNamespaceForClass($implClassName) . "::" . $implClassName;
my $parentName = "";
- $parentName = GetParent($dataNode);
+ $parentName = GetParent($interface);
- my $numConstants = @{$dataNode->constants};
- my $numAttributes = @{$dataNode->attributes};
- my $numFunctions = @{$dataNode->functions};
+ my $numConstants = @{$interface->constants};
+ my $numAttributes = @{$interface->attributes};
+ my $numFunctions = @{$interface->functions};
# - Add default header template
@headerContentHeader = split("\r", $headerLicenseTemplate);
push(@headerContentHeader, "\n#ifndef $className" . "_h");
push(@headerContentHeader, "\n#define $className" . "_h\n\n");
- my $conditionalString = $codeGenerator->GenerateConditionalString($dataNode);
+ my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
push(@headerContentHeader, "#if ${conditionalString}\n\n") if $conditionalString;
# - INCLUDES -
@@ -401,7 +401,7 @@
# - Add constants.
if ($numConstants > 0) {
my @headerConstants = ();
- my @constants = @{$dataNode->constants};
+ my @constants = @{$interface->constants};
my $combinedConstants = "";
# FIXME: we need a way to include multiple enums.
@@ -435,7 +435,7 @@
# - Add attribute getters/setters.
if ($numAttributes > 0) {
- foreach my $attribute (@{$dataNode->attributes}) {
+ foreach my $attribute (@{$interface->attributes}) {
next if SkipAttribute($attribute);
my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
@@ -474,9 +474,9 @@
# - Add functions.
if ($numFunctions > 0) {
- foreach my $function (@{$dataNode->functions}) {
+ foreach my $function (@{$interface->functions}) {
next if SkipFunction($function);
- next if ($function->signature->name eq "set" and $dataNode->extendedAttributes->{"TypedArray"});
+ next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"});
my $functionName = $function->signature->extendedAttributes->{"ImplementedAs"} || $function->signature->name;
my $returnType = GetCPPType($function->signature->type, 0);
@@ -496,7 +496,7 @@
$parameterIndex++;
}
$functionSig .= ")";
- if ($dataNode->extendedAttributes->{"CPPPureInterface"}) {
+ if ($interface->extendedAttributes->{"CPPPureInterface"}) {
push(@interfaceFunctions, " virtual " . $functionSig . " = 0;\n");
}
my $functionDeclaration = $functionSig;
@@ -533,7 +533,7 @@
# for CPPPureInterface classes also add the interface that the client code needs to
# implement
- if ($dataNode->extendedAttributes->{"CPPPureInterface"}) {
+ if ($interface->extendedAttributes->{"CPPPureInterface"}) {
push(@headerContent, "class WebUser$interfaceName {\n");
push(@headerContent, "public:\n");
push(@headerContent, " virtual void ref() = 0;\n");
@@ -547,7 +547,7 @@
my $namespace = GetNamespaceForClass($implClassName);
push(@headerContent, "$namespace" . "::$implClassName* toWebCore(const $className&);\n");
push(@headerContent, "$className toWebKit($namespace" . "::$implClassName*);\n");
- if ($dataNode->extendedAttributes->{"CPPPureInterface"}) {
+ if ($interface->extendedAttributes->{"CPPPureInterface"}) {
push(@headerContent, "$className toWebKit(WebUser$interfaceName*);\n");
}
push(@headerContent, "\n#endif\n");
@@ -590,31 +590,31 @@
sub GenerateImplementation
{
my $object = shift;
- my $dataNode = shift;
+ my $interface = shift;
my @ancestorInterfaceNames = ();
- if (@{$dataNode->parents} > 1) {
- $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($dataNode, \@ancestorInterfaceNames);
+ if (@{$interface->parents} > 1) {
+ $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($interface, \@ancestorInterfaceNames);
}
- my $interfaceName = $dataNode->name;
+ my $interfaceName = $interface->name;
my $className = GetClassName($interfaceName);
my $implClassName = GetImplClassName($interfaceName);
- my $parentImplClassName = GetParentImplClassName($dataNode);
+ my $parentImplClassName = GetParentImplClassName($interface);
my $implClassNameWithNamespace = GetNamespaceForClass($implClassName) . "::" . $implClassName;
my $baseClass = "WebDOM$parentImplClassName";
- my $conditional = $dataNode->extendedAttributes->{"Conditional"};
+ my $conditional = $interface->extendedAttributes->{"Conditional"};
- my $numAttributes = @{$dataNode->attributes};
- my $numFunctions = @{$dataNode->functions};
+ my $numAttributes = @{$interface->attributes};
+ my $numFunctions = @{$interface->functions};
# - Add default header template.
@implContentHeader = split("\r", $implementationLicenseTemplate);
# - INCLUDES -
push(@implContentHeader, "\n#include \"config.h\"\n");
- my $conditionalString = $codeGenerator->GenerateConditionalString($dataNode);
+ my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
push(@implContentHeader, "\n#if ${conditionalString}\n\n") if $conditionalString;
push(@implContentHeader, "#include \"$className.h\"\n\n");
@@ -690,7 +690,7 @@
# - Attributes
if ($numAttributes > 0) {
- foreach my $attribute (@{$dataNode->attributes}) {
+ foreach my $attribute (@{$interface->attributes}) {
next if SkipAttribute($attribute);
AddIncludesForType($attribute->signature->type);
@@ -795,10 +795,10 @@
# - Functions
if ($numFunctions > 0) {
- foreach my $function (@{$dataNode->functions}) {
+ foreach my $function (@{$interface->functions}) {
# Treat CPPPureInterface as Custom as well, since the WebCore versions will take a script context as well
- next if SkipFunction($function) || $dataNode->extendedAttributes->{"CPPPureInterface"};
- next if ($function->signature->name eq "set" and $dataNode->extendedAttributes->{"TypedArray"});
+ next if SkipFunction($function) || $interface->extendedAttributes->{"CPPPureInterface"};
+ next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"});
AddIncludesForType($function->signature->type);
my $functionName = $function->signature->name;