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

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

Issue 138223002: WIP: Implement binding layer for Blink-in-JavaScript Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/v8/BlinkInJavaScriptController.js » ('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 fe3aad63946f832cf861867ba562b4e5be7bfba1..b10537dcbc984102704adfc4f42984f24003c6a7 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -2454,7 +2454,7 @@ END
}
} elsif (!$function->isStatic) {
$code .= <<END;
- ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
+ ${implClassName}* ALLOW_UNUSED imp = ${v8ClassName}::toNative(info.Holder());
END
}
@@ -2483,7 +2483,9 @@ END
}
my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersCheck($function, $interface, $forMainWorldSuffix, $hasExceptionState);
- $code .= $parameterCheckString;
+ if (!$function->extendedAttributes->{"BlinkInJavaScript"}) {
+ $code .= $parameterCheckString;
+ }
# Build the function call string.
$code .= GenerateFunctionCallString($function, $paramIndex, " ", $interface, $forMainWorldSuffix, $hasExceptionState, %replacements);
@@ -5226,6 +5228,20 @@ sub GenerateFunctionCallString
my $index = 0;
my $humanFriendlyIndex = $index + 1;
+ # FIXME: Implement [BlinkInJavaScript] for DOM attributes as well.
+ if ($function->extendedAttributes->{"BlinkInJavaScript"}) {
+ AddToImplIncludes("bindings/v8/V8BlinkInJavaScript.h");
+ $code .= " v8::Handle<v8::Value> argv[] = { ";
+ foreach (my $index = 0; $index < @{$function->parameters}; $index++) {
+ $code .= "info[$index], ";
+ }
+ $code .= "};\n";
+ my $implementedBy = $function->extendedAttributes->{"ImplementedBy"};
+ my $className = $implementedBy ? GetImplNameFromImplementedBy($implementedBy) : $implClassName;
+ $code .= " v8SetReturnValue(info, V8BlinkInJavaScript::runBlinkInJavaScript(\"${className}\", \"${name}\", info.Holder(), WTF_ARRAY_LENGTH(argv), argv, info.GetIsolate()));\n";
+ return $code;
+ }
+
my @arguments;
my $functionName;
my $implementedBy = $function->extendedAttributes->{"ImplementedBy"};
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/BlinkInJavaScriptController.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698