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

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 74533003: Add Perl IDL support for method parameter type sequence<Dictionary> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review changes Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.pm
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index c2dcf11fddadccd5c42f82461b638ab3ad6fa77f..a5f30fc51f9c790ab82b4e535b977715a9510aee 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -437,6 +437,8 @@ sub AddIncludesForType
} elsif ($type eq "EventHandler") {
AddToImplIncludes("bindings/v8/V8AbstractEventListener.h");
AddToImplIncludes("bindings/v8/V8EventListenerList.h");
+ } elsif ($type eq "Dictionary") {
+ AddToImplIncludes("bindings/v8/Dictionary.h");
} elsif (IsTypedArrayType($type)) {
AddToImplIncludes("bindings/v8/custom/V8${type}Custom.h");
} elsif (my $arrayType = GetArrayType($type)) {
@@ -2600,7 +2602,7 @@ END
my $default = defined $parameter->extendedAttributes->{"Default"} ? $parameter->extendedAttributes->{"Default"} : "";
my $jsValue = $parameter->isOptional && $default eq "NullString" ? "argumentOrNull(info, $paramIndex)" : "info[$paramIndex]";
my $stringResourceParameterName = $parameterName;
- my $isNullable = $parameter->isNullable && !IsRefPtrType($parameter->type);
+ my $isNullable = IsNullableParameter($parameter);
if ($isNullable) {
$parameterCheckString .= " bool ${parameterName}IsNull = $jsValue->IsNull();\n";
$stringResourceParameterName .= "StringResource";
@@ -2639,7 +2641,7 @@ END
}
my $default = defined $parameter->extendedAttributes->{"Default"} ? $parameter->extendedAttributes->{"Default"} : "";
my $jsValue = $parameter->isOptional && $default eq "NullString" ? "argumentOrNull(info, $paramIndex)" : "info[$paramIndex]";
- my $isNullable = $parameter->isNullable && !IsRefPtrType($parameter->type);
+ my $isNullable = IsNullableParameter($parameter);
$parameterCheckString .= " bool ${parameterName}IsNull = $jsValue->IsNull();\n" if $isNullable;
$parameterCheckString .= JSValueToNativeStatement($parameter->type, $parameter->extendedAttributes, $humanFriendlyIndex, $jsValue, $parameterName, " ", "info.GetIsolate()");
if ($nativeType eq 'Dictionary' or $nativeType eq 'ScriptPromise') {
@@ -5187,7 +5189,7 @@ sub GenerateFunctionCallString
END
} elsif ($parameter->type eq "SVGMatrix" and $interfaceName eq "SVGTransformList") {
push @arguments, "$paramName.get()";
- } elsif ($parameter->isNullable && !IsRefPtrType($parameter->type)) {
+ } elsif (IsNullableParameter($parameter)) {
push @arguments, "${paramName}IsNull ? 0 : &$paramName";
} else {
push @arguments, $paramName;
@@ -5990,10 +5992,18 @@ sub IsRefPtrType
return 0 if IsCallbackFunctionType($type);
return 0 if IsEnumType($type);
return 0 if IsUnionType($type);
+ return 0 if $type eq "Dictionary";
return 1;
}
+sub IsNullableParameter
+{
+ my $parameter = shift;
+
+ return $parameter->isNullable && !IsRefPtrType($parameter->type) && $parameter->type ne "Dictionary";
+}
+
sub GetSVGTypeNeedingTearOff
{
my $type = shift;
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698