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

Side by Side Diff: Source/bindings/scripts/deprecated_code_generator_v8.pm

Issue 22604003: Make DataTransferItem.getAsString() argument mandatory and nullable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 if ($parameter->isOptional) { 2319 if ($parameter->isOptional) {
2320 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName;\n"; 2320 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName;\n";
2321 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n"; 2321 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n";
2322 $parameterCheckString .= " if (!args[$paramIndex]->IsFunc tion()) {\n"; 2322 $parameterCheckString .= " if (!args[$paramIndex]->IsFunc tion()) {\n";
2323 $parameterCheckString .= " throwTypeError(args.GetIso late());\n"; 2323 $parameterCheckString .= " throwTypeError(args.GetIso late());\n";
2324 $parameterCheckString .= " return;\n"; 2324 $parameterCheckString .= " return;\n";
2325 $parameterCheckString .= " }\n"; 2325 $parameterCheckString .= " }\n";
2326 $parameterCheckString .= " $parameterName = ${v8ClassName }::create(args[$paramIndex], getScriptExecutionContext());\n"; 2326 $parameterCheckString .= " $parameterName = ${v8ClassName }::create(args[$paramIndex], getScriptExecutionContext());\n";
2327 $parameterCheckString .= " }\n"; 2327 $parameterCheckString .= " }\n";
2328 } else { 2328 } else {
2329 $parameterCheckString .= " if (args.Length() <= $paramIndex | | !args[$paramIndex]->IsFunction()) {\n"; 2329 $parameterCheckString .= " if (args.Length() <= $paramIndex | | ";
2330 if ($parameter->isNullable) {
2331 $parameterCheckString .= "!(args[$paramIndex]->IsFunction() || args[$paramIndex]->IsNull())";
2332 } else {
2333 $parameterCheckString .= "!args[$paramIndex]->IsFunction()";
2334 }
2335 $parameterCheckString .= ") {\n";
2330 $parameterCheckString .= " throwTypeError(args.GetIsolate ());\n"; 2336 $parameterCheckString .= " throwTypeError(args.GetIsolate ());\n";
2331 $parameterCheckString .= " return;\n"; 2337 $parameterCheckString .= " return;\n";
2332 $parameterCheckString .= " }\n"; 2338 $parameterCheckString .= " }\n";
2333 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName = ${v8ClassName}::create(args[$paramIndex], getScriptExecutionCont ext());\n"; 2339 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName = ";
2340 $parameterCheckString .= "args[$paramIndex]->IsNull() ? 0 : " if $parameter->isNullable;
2341 $parameterCheckString .= "${v8ClassName}::create(args[$paramInde x], getScriptExecutionContext());\n";
2334 } 2342 }
2335 } elsif ($parameter->extendedAttributes->{"Clamp"}) { 2343 } elsif ($parameter->extendedAttributes->{"Clamp"}) {
2336 my $nativeValue = "${parameterName}NativeValue"; 2344 my $nativeValue = "${parameterName}NativeValue";
2337 my $paramType = $parameter->type; 2345 my $paramType = $parameter->type;
2338 $parameterCheckString .= " $paramType $parameterName = 0;\n"; 2346 $parameterCheckString .= " $paramType $parameterName = 0;\n";
2339 $parameterCheckString .= " V8TRYCATCH_VOID(double, $nativeVal ue, args[$paramIndex]->NumberValue());\n"; 2347 $parameterCheckString .= " V8TRYCATCH_VOID(double, $nativeVal ue, args[$paramIndex]->NumberValue());\n";
2340 $parameterCheckString .= " if (!std::isnan($nativeValue))\n"; 2348 $parameterCheckString .= " if (!std::isnan($nativeValue))\n";
2341 $parameterCheckString .= " $parameterName = clampTo<$para mType>($nativeValue);\n"; 2349 $parameterCheckString .= " $parameterName = clampTo<$para mType>($nativeValue);\n";
2342 } elsif ($parameter->type eq "SerializedScriptValue") { 2350 } elsif ($parameter->type eq "SerializedScriptValue") {
2343 AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); 2351 AddToImplIncludes("bindings/v8/SerializedScriptValue.h");
(...skipping 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after
6020 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6028 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6021 $found = 1; 6029 $found = 1;
6022 } 6030 }
6023 return 1 if $found; 6031 return 1 if $found;
6024 }, 0); 6032 }, 0);
6025 6033
6026 return $found; 6034 return $found;
6027 } 6035 }
6028 6036
6029 1; 6037 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698