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

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

Issue 18677002: [Binding] use V8TRYCATCH_VOID and raw pointer in indexed setter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 5 months 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/TestEventTarget.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/CodeGeneratorV8.pm
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
index d711c309313ead57d573d39e3353f803137e3f7a..34f43f4ac94b5882d79063c97fcc0ec90b831e2e 100644
--- a/Source/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm
@@ -3351,9 +3351,6 @@ sub GenerateImplementationIndexedPropertySetter
$code .= " ExceptionCode ec = 0;\n";
$extraArguments = ", ec";
}
- my $passNativeValue = "propertyValue";
- $passNativeValue .= ".release()" if (IsRefPtrType($type));
haraken 2013/07/04 08:22:38 Why can you remove this?
kojih 2013/07/04 08:30:42 Since this patch changes propertyValue type from R
-
my @conditions = ();
my @statements = ();
if ($treatNullAs && $treatNullAs ne "NullString") {
@@ -3365,7 +3362,7 @@ sub GenerateImplementationIndexedPropertySetter
push @statements, "collection->${treatUndefinedAs}(index$extraArguments);";
}
push @conditions, "";
- push @statements, "collection->${methodName}(index, $passNativeValue$extraArguments);";
+ push @statements, "collection->${methodName}(index, propertyValue$extraArguments);";
$code .= GenerateIfElseStatement("bool", "result", \@conditions, \@statements);
$code .= " if (!result)\n";
@@ -3650,7 +3647,7 @@ sub GenerateNativeValueDefinition
my $treatNullAs = $parameter->extendedAttributes->{"TreatNullAs"} || "";
my $treatUndefinedAs = $parameter->extendedAttributes->{"TreatUndefinedAs"} || "";
my $code = "";
- my $nativeType = GetNativeType($parameter->type);
+ my $nativeType = GetNativeType($parameter->type, 1);
haraken 2013/07/04 08:22:38 I hope this could be "parameter" instead of myster
kojih 2013/07/04 08:30:42 OK, in python generator, this will be named parame
my $nativeValue = JSValueToNative($parameter->type, $function->extendedAttributes, $jsValue, $getIsolate);
if ($parameter->type eq "DOMString") {
my $nullCheck = "";
@@ -3662,7 +3659,7 @@ sub GenerateNativeValueDefinition
}
$code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<${nullCheck}>, ${nativeValueName}, ${jsValue});\n";
} else {
- $code .= " ${nativeType} ${nativeValueName} = ${nativeValue};\n";
+ $code .= " V8TRYCATCH_VOID(${nativeType}, ${nativeValueName}, ${nativeValue});\n";
haraken 2013/07/04 08:22:38 Looks correct but this might affect performance du
kojih 2013/07/04 08:30:42 OK.
}
return $code;
}
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestEventTarget.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698