|
Lines 844-852
sub GenerateHeader
a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec1
|
| 844 |
$numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}); |
844 |
$numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}); |
| 845 |
$numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}); |
845 |
$numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}); |
| 846 |
if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { |
846 |
if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { |
|
|
847 |
my $conditionalString = GenerateConditionalString($attribute->signature); |
| 848 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 847 |
push(@headerContent, " JSC::WriteBarrier<JSC::Unknown> m_" . $attribute->signature->name . ";\n"); |
849 |
push(@headerContent, " JSC::WriteBarrier<JSC::Unknown> m_" . $attribute->signature->name . ";\n"); |
| 848 |
$numCachedAttributes++; |
850 |
$numCachedAttributes++; |
| 849 |
$needsMarkChildren = 1; |
851 |
$needsMarkChildren = 1; |
|
|
852 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 850 |
} |
853 |
} |
| 851 |
} |
854 |
} |
| 852 |
} |
855 |
} |
|
Lines 861-872
sub GenerateHeader
a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec2
|
| 861 |
push(@headerContent, "\n // Custom attributes\n"); |
864 |
push(@headerContent, "\n // Custom attributes\n"); |
| 862 |
|
865 |
|
| 863 |
foreach my $attribute (@{$dataNode->attributes}) { |
866 |
foreach my $attribute (@{$dataNode->attributes}) { |
|
|
867 |
my $conditionalString = GenerateConditionalString($attribute->signature); |
| 864 |
if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) { |
868 |
if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) { |
|
|
869 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 865 |
my $methodName = $codeGenerator->WK_lcfirst($attribute->signature->name); |
870 |
my $methodName = $codeGenerator->WK_lcfirst($attribute->signature->name); |
| 866 |
push(@headerContent, " JSC::JSValue " . $methodName . "(JSC::ExecState*) const;\n"); |
871 |
push(@headerContent, " JSC::JSValue " . $methodName . "(JSC::ExecState*) const;\n"); |
|
|
872 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 867 |
} |
873 |
} |
| 868 |
if (($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}) && $attribute->type !~ /^readonly/) { |
874 |
if (($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}) && $attribute->type !~ /^readonly/) { |
|
|
875 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 869 |
push(@headerContent, " void set" . $codeGenerator->WK_ucfirst($attribute->signature->name) . "(JSC::ExecState*, JSC::JSValue);\n"); |
876 |
push(@headerContent, " void set" . $codeGenerator->WK_ucfirst($attribute->signature->name) . "(JSC::ExecState*, JSC::JSValue);\n"); |
|
|
877 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 870 |
} |
878 |
} |
| 871 |
} |
879 |
} |
| 872 |
} |
880 |
} |
|
Lines 880-887
sub GenerateHeader
a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec3
|
| 880 |
foreach my $function (@{$dataNode->functions}) { |
888 |
foreach my $function (@{$dataNode->functions}) { |
| 881 |
next unless $function->signature->extendedAttributes->{"Custom"} or $function->signature->extendedAttributes->{"JSCustom"}; |
889 |
next unless $function->signature->extendedAttributes->{"Custom"} or $function->signature->extendedAttributes->{"JSCustom"}; |
| 882 |
next if $function->{overloads} && $function->{overloadIndex} != 1; |
890 |
next if $function->{overloads} && $function->{overloadIndex} != 1; |
|
|
891 |
my $conditionalString = GenerateConditionalString($function->signature); |
| 892 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 883 |
my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementedAs"} || $codeGenerator->WK_lcfirst($function->signature->name); |
893 |
my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementedAs"} || $codeGenerator->WK_lcfirst($function->signature->name); |
| 884 |
push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); |
894 |
push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); |
|
|
895 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 885 |
} |
896 |
} |
| 886 |
} |
897 |
} |
| 887 |
|
898 |
|
|
Lines 1067-1086
sub GenerateHeader
a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec4
|
| 1067 |
push(@headerContent,"// Functions\n\n"); |
1078 |
push(@headerContent,"// Functions\n\n"); |
| 1068 |
foreach my $function (@{$dataNode->functions}) { |
1079 |
foreach my $function (@{$dataNode->functions}) { |
| 1069 |
next if $function->{overloadIndex} && $function->{overloadIndex} > 1; |
1080 |
next if $function->{overloadIndex} && $function->{overloadIndex} > 1; |
|
|
1081 |
my $conditionalString = GenerateConditionalString($function->signature); |
| 1082 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 1070 |
my $functionName = GetFunctionName($className, $function); |
1083 |
my $functionName = GetFunctionName($className, $function); |
| 1071 |
push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState*);\n"); |
1084 |
push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState*);\n"); |
|
|
1085 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 1072 |
} |
1086 |
} |
| 1073 |
} |
1087 |
} |
| 1074 |
|
1088 |
|
| 1075 |
if ($numAttributes > 0 || !$dataNode->extendedAttributes->{"OmitConstructor"}) { |
1089 |
if ($numAttributes > 0 || !$dataNode->extendedAttributes->{"OmitConstructor"}) { |
| 1076 |
push(@headerContent,"// Attributes\n\n"); |
1090 |
push(@headerContent,"// Attributes\n\n"); |
| 1077 |
foreach my $attribute (@{$dataNode->attributes}) { |
1091 |
foreach my $attribute (@{$dataNode->attributes}) { |
|
|
1092 |
my $conditionalString = GenerateConditionalString($attribute->signature); |
| 1093 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 1078 |
my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); |
1094 |
my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); |
| 1079 |
push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); |
1095 |
push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); |
| 1080 |
unless ($attribute->type =~ /readonly/) { |
1096 |
unless ($attribute->type =~ /readonly/) { |
| 1081 |
my $setter = "setJS" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); |
1097 |
my $setter = "setJS" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); |
| 1082 |
push(@headerContent, "void ${setter}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);\n"); |
1098 |
push(@headerContent, "void ${setter}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);\n"); |
| 1083 |
} |
1099 |
} |
|
|
1100 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 1084 |
} |
1101 |
} |
| 1085 |
|
1102 |
|
| 1086 |
if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { |
1103 |
if (!$dataNode->extendedAttributes->{"OmitConstructor"}) { |
|
Lines 1097-1110
sub GenerateHeader
a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec5
|
| 1097 |
if ($numConstants > 0) { |
1114 |
if ($numConstants > 0) { |
| 1098 |
push(@headerContent,"// Constants\n\n"); |
1115 |
push(@headerContent,"// Constants\n\n"); |
| 1099 |
foreach my $constant (@{$dataNode->constants}) { |
1116 |
foreach my $constant (@{$dataNode->constants}) { |
|
|
1117 |
my $conditionalString = GenerateConditionalString($constant); |
| 1118 |
push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; |
| 1100 |
my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); |
1119 |
my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); |
| 1101 |
my $conditional = $constant->extendedAttributes->{"Conditional"}; |
|
|
| 1102 |
if ($conditional) { |
| 1103 |
my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); |
| 1104 |
push(@headerContent, "#if ${conditionalString}\n"); |
| 1105 |
} |
| 1106 |
push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); |
1120 |
push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); |
| 1107 |
push(@headerContent, "#endif\n") if $conditional; |
1121 |
push(@headerContent, "#endif\n") if $conditionalString; |
| 1108 |
} |
1122 |
} |
| 1109 |
} |
1123 |
} |
| 1110 |
|
1124 |
|