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

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: Take Arv's feedback into consideration 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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 if ($parameter->isOptional) { 2320 if ($parameter->isOptional) {
2321 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName;\n"; 2321 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName;\n";
2322 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n"; 2322 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n";
2323 $parameterCheckString .= " if (!args[$paramIndex]->IsFunc tion()) {\n"; 2323 $parameterCheckString .= " if (!args[$paramIndex]->IsFunc tion()) {\n";
2324 $parameterCheckString .= " throwTypeError(args.GetIso late());\n"; 2324 $parameterCheckString .= " throwTypeError(args.GetIso late());\n";
2325 $parameterCheckString .= " return;\n"; 2325 $parameterCheckString .= " return;\n";
2326 $parameterCheckString .= " }\n"; 2326 $parameterCheckString .= " }\n";
2327 $parameterCheckString .= " $parameterName = ${v8ClassName }::create(args[$paramIndex], getScriptExecutionContext());\n"; 2327 $parameterCheckString .= " $parameterName = ${v8ClassName }::create(args[$paramIndex], getScriptExecutionContext());\n";
2328 $parameterCheckString .= " }\n"; 2328 $parameterCheckString .= " }\n";
2329 } else { 2329 } else {
2330 $parameterCheckString .= " if (args.Length() <= $paramIndex | | !args[$paramIndex]->IsFunction()) {\n"; 2330 $parameterCheckString .= " if (args.Length() <= $paramIndex | | ";
2331 if ($parameter->isNullable) {
2332 $parameterCheckString .= "!(args[$paramIndex]->IsFunction() || args[$paramIndex]->IsNull())";
2333 } else {
2334 $parameterCheckString .= "!args[$paramIndex]->IsFunction()";
2335 }
2336 $parameterCheckString .= ") {\n";
2331 $parameterCheckString .= " throwTypeError(args.GetIsolate ());\n"; 2337 $parameterCheckString .= " throwTypeError(args.GetIsolate ());\n";
2332 $parameterCheckString .= " return;\n"; 2338 $parameterCheckString .= " return;\n";
2333 $parameterCheckString .= " }\n"; 2339 $parameterCheckString .= " }\n";
2334 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName = ${v8ClassName}::create(args[$paramIndex], getScriptExecutionCont ext());\n"; 2340 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $ parameterName = ";
2341 $parameterCheckString .= "args[$paramIndex]->IsNull() ? 0 : " if $parameter->isNullable;
2342 $parameterCheckString .= "${v8ClassName}::create(args[$paramInde x], getScriptExecutionContext());\n";
2335 } 2343 }
2336 } elsif ($parameter->extendedAttributes->{"Clamp"}) { 2344 } elsif ($parameter->extendedAttributes->{"Clamp"}) {
2337 my $nativeValue = "${parameterName}NativeValue"; 2345 my $nativeValue = "${parameterName}NativeValue";
2338 my $paramType = $parameter->type; 2346 my $paramType = $parameter->type;
2339 $parameterCheckString .= " $paramType $parameterName = 0;\n"; 2347 $parameterCheckString .= " $paramType $parameterName = 0;\n";
2340 $parameterCheckString .= " V8TRYCATCH_VOID(double, $nativeVal ue, args[$paramIndex]->NumberValue());\n"; 2348 $parameterCheckString .= " V8TRYCATCH_VOID(double, $nativeVal ue, args[$paramIndex]->NumberValue());\n";
2341 $parameterCheckString .= " if (!std::isnan($nativeValue))\n"; 2349 $parameterCheckString .= " if (!std::isnan($nativeValue))\n";
2342 $parameterCheckString .= " $parameterName = clampTo<$para mType>($nativeValue);\n"; 2350 $parameterCheckString .= " $parameterName = clampTo<$para mType>($nativeValue);\n";
2343 } elsif ($parameter->type eq "SerializedScriptValue") { 2351 } elsif ($parameter->type eq "SerializedScriptValue") {
2344 AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); 2352 AddToImplIncludes("bindings/v8/SerializedScriptValue.h");
(...skipping 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after
6001 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6009 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6002 $found = 1; 6010 $found = 1;
6003 } 6011 }
6004 return 1 if $found; 6012 return 1 if $found;
6005 }, 0); 6013 }, 0);
6006 6014
6007 return $found; 6015 return $found;
6008 } 6016 }
6009 6017
6010 1; 6018 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698