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

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

Issue 14387012: Absolutify paths to svg/properties/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 8 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
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestObj.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); 256 $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
257 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN ativeType; 257 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN ativeType;
258 258
259 # Append space to avoid compilation errors when using PassRefPtr<$svgNative Type> 259 # Append space to avoid compilation errors when using PassRefPtr<$svgNative Type>
260 $svgNativeType = "$svgNativeType "; 260 $svgNativeType = "$svgNativeType ";
261 261
262 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($ implType); 262 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($ implType);
263 if ($svgNativeType =~ /SVGPropertyTearOff/) { 263 if ($svgNativeType =~ /SVGPropertyTearOff/) {
264 $svgPropertyType = $svgWrappedNativeType; 264 $svgPropertyType = $svgWrappedNativeType;
265 AddToImplIncludes("SVGAnimatedPropertyTearOff.h"); 265 AddToImplIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h");
266 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV GStaticListPropertyTearOff/) { 266 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV GStaticListPropertyTearOff/) {
267 $svgListPropertyType = $svgWrappedNativeType; 267 $svgListPropertyType = $svgWrappedNativeType;
268 $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 268 $headerIncludes{"core/svg/properties/SVGAnimatedListPropertyTearOff.h"} = 1;
269 $headerIncludes{"SVGStaticListPropertyTearOff.h"} = 1; 269 $headerIncludes{"core/svg/properties/SVGStaticListPropertyTearOff.h"} = 1;
270 } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { 270 } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) {
271 $svgListPropertyType = $svgWrappedNativeType; 271 $svgListPropertyType = $svgWrappedNativeType;
272 $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 272 $headerIncludes{"core/svg/properties/SVGAnimatedListPropertyTearOff.h"} = 1;
273 $headerIncludes{"SVGTransformListPropertyTearOff.h"} = 1; 273 $headerIncludes{"core/svg/properties/SVGTransformListPropertyTearOff.h"} = 1;
274 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { 274 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) {
275 $svgListPropertyType = $svgWrappedNativeType; 275 $svgListPropertyType = $svgWrappedNativeType;
276 $headerIncludes{"SVGPathSegListPropertyTearOff.h"} = 1; 276 $headerIncludes{"core/svg/properties/SVGPathSegListPropertyTearOff.h"} = 1;
277 } 277 }
278 278
279 if ($svgPropertyType) { 279 if ($svgPropertyType) {
280 $svgPropertyType = "SVGPoint" if $svgPropertyType eq "FloatPoint"; 280 $svgPropertyType = "SVGPoint" if $svgPropertyType eq "FloatPoint";
281 } 281 }
282 282
283 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); 283 return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
284 } 284 }
285 285
286 sub GetNamedGetterFunction 286 sub GetNamedGetterFunction
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 return; 1283 return;
1284 } 1284 }
1285 1285
1286 if (($codeGenerator->IsSVGAnimatedType($interfaceName) or $interfaceName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) { 1286 if (($codeGenerator->IsSVGAnimatedType($interfaceName) or $interfaceName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {
1287 AddToImplIncludes("V8$attrType.h"); 1287 AddToImplIncludes("V8$attrType.h");
1288 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 1288 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
1289 # Convert from abstract SVGProperty to real type, so the right toJS() me thod can be invoked. 1289 # Convert from abstract SVGProperty to real type, so the right toJS() me thod can be invoked.
1290 $code .= " return toV8Fast$forMainWorldSuffix(static_cast<$svgNativeT ype*>($expression), info, imp);\n"; 1290 $code .= " return toV8Fast$forMainWorldSuffix(static_cast<$svgNativeT ype*>($expression), info, imp);\n";
1291 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $interfa ceName =~ /List$/) { 1291 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $interfa ceName =~ /List$/) {
1292 AddToImplIncludes("V8$attrType.h"); 1292 AddToImplIncludes("V8$attrType.h");
1293 AddToImplIncludes("SVGPropertyTearOff.h"); 1293 AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h");
1294 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 1294 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
1295 my $wrappedValue; 1295 my $wrappedValue;
1296 if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($attrT ype) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { 1296 if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($attrT ype) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) {
1297 my $getter = $expression; 1297 my $getter = $expression;
1298 $getter =~ s/imp->//; 1298 $getter =~ s/imp->//;
1299 $getter =~ s/\(\)//; 1299 $getter =~ s/\(\)//;
1300 1300
1301 my $updateMethod = "&${interfaceName}::update" . $codeGenerator->WK_ ucfirst($getter); 1301 my $updateMethod = "&${interfaceName}::update" . $codeGenerator->WK_ ucfirst($getter);
1302 1302
1303 my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($int erfaceName); 1303 my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($int erfaceName);
1304 if ($selfIsTearOffType) { 1304 if ($selfIsTearOffType) {
1305 AddToImplIncludes("SVGStaticPropertyWithParentTearOff.h"); 1305 AddToImplIncludes("core/svg/properties/SVGStaticPropertyWithPare ntTearOff.h");
1306 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParen tTearOff<$interfaceName, /; 1306 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParen tTearOff<$interfaceName, /;
1307 1307
1308 if ($expression =~ /matrix/ and $interfaceName eq "SVGTransform" ) { 1308 if ($expression =~ /matrix/ and $interfaceName eq "SVGTransform" ) {
1309 # SVGTransform offers a matrix() method for internal usage t hat returns an AffineTransform 1309 # SVGTransform offers a matrix() method for internal usage t hat returns an AffineTransform
1310 # and a svgMatrix() method returning a SVGMatrix, used for t he bindings. 1310 # and a svgMatrix() method returning a SVGMatrix, used for t he bindings.
1311 $expression =~ s/matrix/svgMatrix/; 1311 $expression =~ s/matrix/svgMatrix/;
1312 } 1312 }
1313 1313
1314 $wrappedValue = "WTF::getPtr(${tearOffType}::create(wrapper, $ex pression, $updateMethod))"; 1314 $wrappedValue = "WTF::getPtr(${tearOffType}::create(wrapper, $ex pression, $updateMethod))";
1315 } else { 1315 } else {
1316 AddToImplIncludes("SVGStaticPropertyTearOff.h"); 1316 AddToImplIncludes("core/svg/properties/SVGStaticPropertyTearOff. h");
1317 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$ interfaceName, /; 1317 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$ interfaceName, /;
1318 1318
1319 $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expres sion, $updateMethod))"; 1319 $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expres sion, $updateMethod))";
1320 } 1320 }
1321 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) { 1321 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
1322 $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expres sion))"; 1322 $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $expres sion))";
1323 } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) { 1323 } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) {
1324 $wrappedValue = "WTF::getPtr($expression)"; 1324 $wrappedValue = "WTF::getPtr($expression)";
1325 } else { 1325 } else {
1326 $wrappedValue = "WTF::getPtr(${tearOffType}::create($expression) )"; 1326 $wrappedValue = "WTF::getPtr(${tearOffType}::create($expression) )";
(...skipping 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) { 4305 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) {
4306 $code .= $indent . "if (state.hadException()) {\n"; 4306 $code .= $indent . "if (state.hadException()) {\n";
4307 $code .= $indent . " v8::Local<v8::Value> exception = state.exception ();\n"; 4307 $code .= $indent . " v8::Local<v8::Value> exception = state.exception ();\n";
4308 $code .= $indent . " state.clearException();\n"; 4308 $code .= $indent . " state.clearException();\n";
4309 $code .= $indent . " return throwError(exception, args.GetIsolate()); \n"; 4309 $code .= $indent . " return throwError(exception, args.GetIsolate()); \n";
4310 $code .= $indent . "}\n"; 4310 $code .= $indent . "}\n";
4311 } 4311 }
4312 4312
4313 if ($isSVGTearOffType) { 4313 if ($isSVGTearOffType) {
4314 AddToImplIncludes("V8$returnType.h"); 4314 AddToImplIncludes("V8$returnType.h");
4315 AddToImplIncludes("SVGPropertyTearOff.h"); 4315 AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h");
4316 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType ); 4316 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType );
4317 # FIXME: Update for all ScriptWrappables. 4317 # FIXME: Update for all ScriptWrappables.
4318 if (IsDOMNodeType($interfaceName)) { 4318 if (IsDOMNodeType($interfaceName)) {
4319 $code .= $indent . "return toV8Fast${forMainWorldSuffix}(WTF::getPtr (${svgNativeType}::create($return)), args, imp);\n"; 4319 $code .= $indent . "return toV8Fast${forMainWorldSuffix}(WTF::getPtr (${svgNativeType}::create($return)), args, imp);\n";
4320 } else { 4320 } else {
4321 $code .= $indent . "return toV8${forMainWorldSuffix}(WTF::getPtr(${s vgNativeType}::create($return)), args.Holder(), args.GetIsolate());\n"; 4321 $code .= $indent . "return toV8${forMainWorldSuffix}(WTF::getPtr(${s vgNativeType}::create($return)), args.Holder(), args.GetIsolate());\n";
4322 } 4322 }
4323 return $code; 4323 return $code;
4324 } 4324 }
4325 4325
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
4913 4913
4914 sub GetPassRefPtrType 4914 sub GetPassRefPtrType
4915 { 4915 {
4916 my $v8InterfaceName = shift; 4916 my $v8InterfaceName = shift;
4917 4917
4918 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; 4918 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : "";
4919 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; 4919 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>";
4920 } 4920 }
4921 4921
4922 1; 4922 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestObj.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698