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

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

Issue 19510005: [oilpan] Completely move HTMLFormControlElement's hierarchy to the managed heap Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 "SVGColor" => 1, 89 "SVGColor" => 1,
90 "SVGPaint" => 1, 90 "SVGPaint" => 1,
91 "CSSValueList" => 1, 91 "CSSValueList" => 1,
92 "StyleSheetList" => 1, 92 "StyleSheetList" => 1,
93 "DOMWindowCSS" => 1, 93 "DOMWindowCSS" => 1,
94 "StyleMedia" => 1, 94 "StyleMedia" => 1,
95 "ViewportStyleResolver" => 1, 95 "ViewportStyleResolver" => 1,
96 "WebKitCSSMatrix" => 1, 96 "WebKitCSSMatrix" => 1,
97 ); 97 );
98 98
99 my %partiallyHandlifiedTypeHash = (); 99 my %partiallyHandlifiedTypeHash = (
100 "HTMLKeygenElement" => 1,
101 "HTMLOutputElement" => 1,
102 "HTMLSelectElement" => 1,
103 "HTMLInputElement" => 1,
104 "HTMLTextAreaElement" => 1,
105 "HTMLButtonElement" => 1,
106 );
100 107
101 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, 108 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
102 "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" = > 1, 109 "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" = > 1,
103 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1, 110 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
104 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1, 111 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1,
105 "SVGAnimatedPreserveAspectRatio" => 1, 112 "SVGAnimatedPreserveAspectRatio" => 1,
106 "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1, 113 "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1,
107 "SVGAnimatedTransformList" => 1); 114 "SVGAnimatedTransformList" => 1);
108 115
109 my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick " => 1, 116 my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick " => 1,
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 my $handlifiedReturnType = IsHandlifiedType($returnType) || IsPartiallyHandl ifiedType($returnType); 1314 my $handlifiedReturnType = IsHandlifiedType($returnType) || IsPartiallyHandl ifiedType($returnType);
1308 my $getterString; 1315 my $getterString;
1309 1316
1310 if ($getterStringUsesImp) { 1317 if ($getterStringUsesImp) {
1311 my ($functionName, @arguments) = GetterExpression(\%implIncludes, $inter faceName, $attribute); 1318 my ($functionName, @arguments) = GetterExpression(\%implIncludes, $inter faceName, $attribute);
1312 push(@arguments, "isNull") if $isNullable; 1319 push(@arguments, "isNull") if $isNullable;
1313 push(@arguments, "ec") if $useExceptions; 1320 push(@arguments, "ec") if $useExceptions;
1314 if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { 1321 if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
1315 my $implementedBy = $attribute->signature->extendedAttributes->{"Imp lementedBy"}; 1322 my $implementedBy = $attribute->signature->extendedAttributes->{"Imp lementedBy"};
1316 AddInterfaceToImplIncludes($implementedBy); 1323 AddInterfaceToImplIncludes($implementedBy);
1317 unshift(@arguments, "imp") if !$attribute->isStatic; 1324 unshift(@arguments, $handlified ? "imp.raw()" : "imp") if !$attribut e->isStatic;
1318 $functionName = "${implementedBy}::${functionName}"; 1325 $functionName = "${implementedBy}::${functionName}";
1319 } elsif ($attribute->isStatic) { 1326 } elsif ($attribute->isStatic) {
1320 $functionName = "${interfaceName}::${functionName}"; 1327 $functionName = "${interfaceName}::${functionName}";
1321 } else { 1328 } else {
1322 $functionName = "imp->${functionName}"; 1329 $functionName = "imp->${functionName}";
1323 } 1330 }
1324 my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAt tributes->{"CallWith"}, " ", 0); 1331 my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAt tributes->{"CallWith"}, " ", 0);
1325 $code .= $subCode; 1332 $code .= $subCode;
1326 unshift(@arguments, @$arg); 1333 unshift(@arguments, @$arg);
1327 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; 1334 $getterString = "${functionName}(" . join(", ", @arguments) . ")";
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 END 1485 END
1479 } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt- >{"CachedAttribute"}) { 1486 } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt- >{"CachedAttribute"}) {
1480 my $getterFunc = WK_lcfirst($attribute->signature->name); 1487 my $getterFunc = WK_lcfirst($attribute->signature->name);
1481 $code .= <<END; 1488 $code .= <<END;
1482 RefPtr<SerializedScriptValue> serialized = imp->${getterFunc}(); 1489 RefPtr<SerializedScriptValue> serialized = imp->${getterFunc}();
1483 value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Nul l(info.GetIsolate())); 1490 value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Nul l(info.GetIsolate()));
1484 info.Holder()->SetHiddenValue(propertyName, value); 1491 info.Holder()->SetHiddenValue(propertyName, value);
1485 return value; 1492 return value;
1486 END 1493 END
1487 } else { 1494 } else {
1488 $code .= " return " . NativeToJSValue($attribute->signature, $express ion, "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsafeHandle", $forMainWorldSuffix).";\n"; 1495 $code .= " return " . NativeToJSValue($attribute->signature, $express ion, "info.Holder()", "info.GetIsolate()", "info", $handlified ? "imp.raw()" : " imp", "ReturnUnsafeHandle", $forMainWorldSuffix).";\n";
1489 } 1496 }
1490 1497
1491 $code .= "}\n\n"; # end of getter 1498 $code .= "}\n\n"; # end of getter
1492 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; 1499 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString;
1493 AddToImplContentInternals($code); 1500 AddToImplContentInternals($code);
1494 } 1501 }
1495 1502
1496 sub GenerateReplaceableAttrSetterCallback 1503 sub GenerateReplaceableAttrSetterCallback
1497 { 1504 {
1498 my $interface = shift; 1505 my $interface = shift;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 $code .= " $svgWrappedNativeType* imp = &impInstance;\n"; 1655 $code .= " $svgWrappedNativeType* imp = &impInstance;\n";
1649 } 1656 }
1650 } elsif ($attrExt->{"OnProto"}) { 1657 } elsif ($attrExt->{"OnProto"}) {
1651 $code .= <<END; 1658 $code .= <<END;
1652 ${pointerType} imp(${v8InterfaceName}::toNative(info.Holder())); 1659 ${pointerType} imp(${v8InterfaceName}::toNative(info.Holder()));
1653 END 1660 END
1654 } else { 1661 } else {
1655 my $reflect = $attribute->signature->extendedAttributes->{"Reflect"}; 1662 my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
1656 if ($reflect && InheritsInterface($interface, "Node") && IsStringType($a ttrType)) { 1663 if ($reflect && InheritsInterface($interface, "Node") && IsStringType($a ttrType)) {
1657 # Generate super-compact call for regular attribute setter: 1664 # Generate super-compact call for regular attribute setter:
1665 if ($attribute->signature->extendedAttributes->{"ImplementedAs"}) {
1666 $attrName = $attribute->signature->extendedAttributes->{"Impleme ntedAs"};
1667 }
1658 my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attr Name : $reflect; 1668 my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attr Name : $reflect;
1659 my $namespace = NamespaceForAttributeName($interfaceName, $contentAt tributeName); 1669 my $namespace = NamespaceForAttributeName($interfaceName, $contentAt tributeName);
1660 AddToImplIncludes("${namespace}.h"); 1670 AddToImplIncludes("${namespace}.h");
1661 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; 1671 $code .= " Element* imp = V8Element::toNative(info.Holder());\n";
1662 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource< WithNullCheck>, stringResource, value);\n"; 1672 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource< WithNullCheck>, stringResource, value);\n";
1663 $code .= " imp->setAttribute(${namespace}::${contentAttributeName }Attr, stringResource);\n"; 1673 $code .= " imp->setAttribute(${namespace}::${contentAttributeName }Attr, stringResource);\n";
1664 $code .= "}\n\n"; 1674 $code .= "}\n\n";
1665 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; 1675 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString;
1666 AddToImplContentInternals($code); 1676 AddToImplContentInternals($code);
1667 return; 1677 return;
(...skipping 3982 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 5660 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
5651 $found = 1; 5661 $found = 1;
5652 } 5662 }
5653 return 1 if $found; 5663 return 1 if $found;
5654 }, 0); 5664 }, 0);
5655 5665
5656 return $found; 5666 return $found;
5657 } 5667 }
5658 5668
5659 1; 5669 1;
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.cpp ('k') | Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698