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

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

Issue 14882009: Remove DOM prefix from several IDL interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 7 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 | « Source/bindings/bindings.gypi ('k') | Source/bindings/tests/idls/TestCallback.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 729f75aac59b3d3e324e9200970e529158d0007d..862fd09ec4cb00c52f24c4e13a9852272d01f8c4 100644
--- a/Source/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm
@@ -1557,7 +1557,8 @@ END
AddToImplIncludes("bindings/v8/V8HiddenPropertyName.h");
# Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already
# been created. If we don't find a wrapper, we create both a wrapper and a hidden reference.
- $code .= " RefPtr<$returnType> result = ${getterString};\n";
+ my $nativeReturnType = GetNativeType($returnType);
+ $code .= " $nativeReturnType result = ${getterString};\n";
if ($forMainWorldSuffix) {
$code .= " v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMDataStore::getWrapper${forMainWorldSuffix}(result.get())) : v8Undefined();\n";
} else {
@@ -2385,10 +2386,12 @@ sub GenerateParametersCheck
# Optional arguments with [Optional=...] should not generate the early call.
# Optional Dictionary arguments always considered to have default of empty dictionary.
if ($parameter->isOptional && !$parameter->extendedAttributes->{"Default"} && $nativeType ne "Dictionary" && !IsCallbackInterface($parameter->type)) {
- $parameterCheckString .= " if (args.Length() <= $paramIndex) {\n";
+ $parameterCheckString .= " if (args.Length() <= $paramIndex)";
my $functionCall = GenerateFunctionCallString($function, $paramIndex, " " x 2, $interface, $forMainWorldSuffix, %replacements);
+ my $multiLine = ($functionCall =~ tr/\n//) > 1;
+ $parameterCheckString .= $multiLine ? " {\n" : "\n";
$parameterCheckString .= $functionCall;
- $parameterCheckString .= " }\n";
+ $parameterCheckString .= $multiLine ? " }\n" : "\n";
}
my $parameterDefaultPolicy = "DefaultIsUndefined";
@@ -3969,12 +3972,11 @@ END
my $functionLength = GetFunctionLength($runtimeFunc);
my $conditionalString = GenerateConditionalString($runtimeFunc->signature);
$code .= "\n#if ${conditionalString}\n" if $conditionalString;
- $code .= " if (context && context->isDocument() && ${enableFunction}(toDocument(context))) {\n";
+ $code .= " if (context && context->isDocument() && ${enableFunction}(toDocument(context)))\n";
my $name = $runtimeFunc->signature->name;
$code .= <<END;
proto->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), defaultSignature, $functionLength)->GetFunction());
END
- $code .= " }\n";
$code .= "#endif // ${conditionalString}\n" if $conditionalString;
}
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/tests/idls/TestCallback.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698