Chromium Code Reviews| Index: Source/bindings/scripts/CodeGeneratorV8.pm |
| diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm |
| index ba38bb6987608368159bb8aa9ef736af889ee1b9..3efa093ba781221f2e65d2d1faf6dc745a324318 100644 |
| --- a/Source/bindings/scripts/CodeGeneratorV8.pm |
| +++ b/Source/bindings/scripts/CodeGeneratorV8.pm |
| @@ -29,6 +29,8 @@ package CodeGeneratorV8; |
| use strict; |
| +use idltopath; |
| + |
| my $codeGenerator; |
| @@ -145,16 +147,16 @@ sub AddIncludesForType |
| if ($type =~ /SVGPathSeg/) { |
| my $joinedName = $type; |
| $joinedName =~ s/Abs|Rel//; |
| - AddToImplIncludes("${joinedName}.h"); |
| + AddToImplIncludes("core/svg/${joinedName}.h"); |
| } |
| } |
| # additional includes (things needed to compile the bindings but not the header) |
| if ($type eq "CanvasRenderingContext2D") { |
| - AddToImplIncludes("CanvasGradient.h"); |
| - AddToImplIncludes("CanvasPattern.h"); |
| - AddToImplIncludes("CanvasStyle.h"); |
| + AddToImplIncludes("core/html/canvas/CanvasGradient.h"); |
| + AddToImplIncludes("core/html/canvas/CanvasPattern.h"); |
| + AddToImplIncludes("core/html/canvas/CanvasStyle.h"); |
| } |
| if ($type eq "CanvasGradient" or $type eq "XPathNSResolver") { |
| @@ -162,11 +164,11 @@ sub AddIncludesForType |
| } |
| if ($type eq "CSSStyleSheet" or $type eq "StyleSheet") { |
| - AddToImplIncludes("CSSImportRule.h"); |
| + AddToImplIncludes("core/css/CSSImportRule.h"); |
| } |
| if ($type eq "CSSStyleDeclaration") { |
| - AddToImplIncludes("StylePropertySet.h"); |
| + AddToImplIncludes("core/css/StylePropertySet.h"); |
| } |
| if ($type eq "Plugin" or $type eq "PluginArray" or $type eq "MimeTypeArray") { |
| @@ -213,7 +215,7 @@ END |
| GetGenerateIsReachable($interface) eq "ImplOwnerRoot" || |
| GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { |
| - $implIncludes{"V8GCController.h"} = 1; |
| + $implIncludes{"bindings/v8/V8GCController.h"} = 1; |
|
abarth-chromium
2013/04/25 14:14:24
Why not use the header map for these headers as we
Daniel Bratell
2013/04/25 21:24:26
This is not an IDL interface name so these are not
|
| my $methodName; |
| $methodName = "document" if (GetGenerateIsReachable($interface) eq "ImplDocument"); |
| @@ -254,18 +256,18 @@ sub GetSVGPropertyTypes |
| my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); |
| if ($svgNativeType =~ /SVGPropertyTearOff/) { |
| $svgPropertyType = $svgWrappedNativeType; |
| - AddToImplIncludes("SVGAnimatedPropertyTearOff.h"); |
| + AddToImplIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h"); |
| } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/) { |
| $svgListPropertyType = $svgWrappedNativeType; |
| - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; |
| - $headerIncludes{"SVGStaticListPropertyTearOff.h"} = 1; |
| + $headerIncludes{"core/svg/properties/SVGAnimatedListPropertyTearOff.h"} = 1; |
| + $headerIncludes{"core/svg/properties/SVGStaticListPropertyTearOff.h"} = 1; |
| } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { |
| $svgListPropertyType = $svgWrappedNativeType; |
| - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; |
| - $headerIncludes{"SVGTransformListPropertyTearOff.h"} = 1; |
| + $headerIncludes{"core/svg/properties/SVGAnimatedListPropertyTearOff.h"} = 1; |
| + $headerIncludes{"core/svg/properties/SVGTransformListPropertyTearOff.h"} = 1; |
| } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { |
| $svgListPropertyType = $svgWrappedNativeType; |
| - $headerIncludes{"SVGPathSegListPropertyTearOff.h"} = 1; |
| + $headerIncludes{"core/svg/properties/SVGPathSegListPropertyTearOff.h"} = 1; |
| } |
| if ($svgPropertyType) { |
| @@ -303,9 +305,9 @@ sub GenerateHeader |
| AddToHeader(GenerateHeaderContentHeader($interface)); |
| $headerIncludes{"wtf/text/StringHash.h"} = 1; |
| - $headerIncludes{"WrapperTypeInfo.h"} = 1; |
| - $headerIncludes{"V8Binding.h"} = 1; |
| - $headerIncludes{"V8DOMWrapper.h"} = 1; |
| + $headerIncludes{"bindings/v8/WrapperTypeInfo.h"} = 1; |
| + $headerIncludes{"bindings/v8/V8Binding.h"} = 1; |
| + $headerIncludes{"bindings/v8/V8DOMWrapper.h"} = 1; |
| $headerIncludes{"wtf/HashMap.h"} = 1; |
| $headerIncludes{"v8.h"} = 1; |
| @@ -679,6 +681,13 @@ sub GetInternalFields |
| return @customInternalFields; |
| } |
| +sub mapInterfaceToIncludePath |
| +{ |
| + my $interface = shift; |
| + |
| + return idlToPath($interface); |
| +} |
| + |
| sub GetHeaderClassInclude |
| { |
| my $v8InterfaceName = shift; |
| @@ -687,7 +696,8 @@ sub GetHeaderClassInclude |
| } |
| return "wtf/${v8InterfaceName}.h" if $codeGenerator->IsTypedArrayType($v8InterfaceName); |
| return "" if ($codeGenerator->SkipIncludeHeader($v8InterfaceName)); |
| - return "${v8InterfaceName}.h"; |
| + my $interfacepath = mapInterfaceToIncludePath($v8InterfaceName); |
| + return "${interfacepath}${v8InterfaceName}.h"; |
| } |
| sub GenerateHeaderCustomInternalFieldIndices |
| @@ -872,7 +882,7 @@ sub GenerateDomainSafeFunctionGetter |
| my $newTemplateParams = "${interfaceName}V8Internal::${funcName}MethodCallback, v8Undefined(), $signature"; |
| - AddToImplIncludes("Frame.h"); |
| + AddToImplIncludes("core/page/Frame.h"); |
| AddToImplContentInternals(<<END); |
| static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) |
| { |
| @@ -1135,7 +1145,7 @@ END |
| my $useExceptions = 1 if $attribute->signature->extendedAttributes->{"GetterRaisesException"}; |
| my $isNullable = $attribute->signature->isNullable; |
| if ($useExceptions) { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= " ExceptionCode ec = 0;\n"; |
| } |
| @@ -1152,7 +1162,8 @@ END |
| push(@arguments, "ec") if $useExceptions; |
| if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { |
| my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; |
| - AddToImplIncludes("${implementedBy}.h"); |
| + my $implementedByPath = idlToPath($implementedBy); |
| + AddToImplIncludes("${implementedByPath}${implementedBy}.h"); |
| unshift(@arguments, "imp") if !$attribute->isStatic; |
| $functionName = "${implementedBy}::${functionName}"; |
| } elsif ($attribute->isStatic) { |
| @@ -1218,7 +1229,7 @@ END |
| if ($arrayType) { |
| if (!$codeGenerator->SkipIncludeHeader($arrayType)) { |
| AddToImplIncludes("V8$arrayType.h"); |
| - AddToImplIncludes("$arrayType.h"); |
| + AddToImplIncludes("bindings/v8/$arrayType.h"); |
| } |
| $code .= " return v8Array(${getterString}, info.GetIsolate());\n"; |
| $code .= "}\n\n"; |
| @@ -1254,7 +1265,7 @@ END |
| $code .= " return toV8Fast$forMainWorldSuffix(static_cast<$svgNativeType*>($expression), info, imp);\n"; |
| } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $interfaceName =~ /List$/) { |
| AddToImplIncludes("V8$attrType.h"); |
| - AddToImplIncludes("SVGPropertyTearOff.h"); |
| + AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h"); |
| my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); |
| my $wrappedValue; |
| if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { |
| @@ -1266,7 +1277,7 @@ END |
| my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interfaceName); |
| if ($selfIsTearOffType) { |
| - AddToImplIncludes("SVGStaticPropertyWithParentTearOff.h"); |
| + AddToImplIncludes("core/svg/properties/SVGStaticPropertyWithParentTearOff.h"); |
| $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$interfaceName, /; |
| if ($expression =~ /matrix/ and $interfaceName eq "SVGTransform") { |
| @@ -1349,7 +1360,7 @@ static void ${interfaceName}ReplaceableAttrSetter(v8::Local<v8::String> name, v8 |
| { |
| END |
| if ($interface->extendedAttributes->{"CheckSecurity"}) { |
| - AddToImplIncludes("Frame.h"); |
| + AddToImplIncludes("core/page/Frame.h"); |
| $code .= <<END; |
| ${interfaceName}* imp = V8${interfaceName}::toNative(info.Holder()); |
| if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame())) |
| @@ -1375,7 +1386,7 @@ sub GenerateCustomElementInvocationScopeIfNeeded |
| die "IDL error: [Reflect] and [DeliverCustomElementCallbacks] cannot coexist yet"; |
| } |
| - AddToImplIncludes("CustomElementRegistry.h", "CUSTOM_ELEMENTS"); |
| + AddToImplIncludes("core/dom/CustomElementRegistry.h", "CUSTOM_ELEMENTS"); |
| $code .= <<END; |
| #if ENABLE(CUSTOM_ELEMENTS) |
| CustomElementRegistry::CallbackDeliveryScope deliveryScope; |
| @@ -1461,7 +1472,7 @@ sub GenerateNormalAttrSetter |
| $svgNativeType* imp = ${v8InterfaceName}::toNative(info.Holder()); |
| END |
| } else { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= " $svgNativeType* wrapper = ${v8InterfaceName}::toNative(info.Holder());\n"; |
| $code .= " if (wrapper->isReadOnly()) {\n"; |
| $code .= " setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n"; |
| @@ -1545,7 +1556,7 @@ END |
| my $useExceptions = 1 if $attribute->signature->extendedAttributes->{"SetterRaisesException"}; |
| if ($useExceptions) { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= " ExceptionCode ec = 0;\n"; |
| } |
| @@ -1554,16 +1565,16 @@ END |
| } else { |
| if ($attribute->signature->type eq "EventListener") { |
| my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName); |
| - AddToImplIncludes("V8AbstractEventListener.h"); |
| + AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| if (!$codeGenerator->InheritsInterface($interface, "Node")) { |
| $code .= " transferHiddenDependency(info.Holder(), imp->$attrName(), value, ${v8InterfaceName}::eventListenerCacheIndex, info.GetIsolate());\n"; |
| } |
| - AddToImplIncludes("V8EventListenerList.h"); |
| + AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| if ($interfaceName eq "WorkerContext" and $attribute->signature->name eq "onerror") { |
| - AddToImplIncludes("V8WorkerContextErrorHandler.h"); |
| + AddToImplIncludes("bindings/v8/V8WorkerContextErrorHandler.h"); |
| $code .= " imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)"; |
| } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->name eq "onerror") { |
| - AddToImplIncludes("V8WindowErrorHandler.h"); |
| + AddToImplIncludes("bindings/v8/V8WindowErrorHandler.h"); |
| $code .= " imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WindowErrorHandler>(value, true)"; |
| } else { |
| $code .= " imp->set$implSetterFunctionName(V8EventListenerList::getEventListener(value, true, ListenerFindOrCreate)"; |
| @@ -1576,7 +1587,8 @@ END |
| push(@arguments, "ec") if $useExceptions; |
| if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { |
| my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; |
| - AddToImplIncludes("${implementedBy}.h"); |
| + my $implementedByPath = idlToPath($implementedBy); |
| + AddToImplIncludes("$implementedByPath${implementedBy}.h"); |
| unshift(@arguments, "imp") if !$attribute->isStatic; |
| $functionName = "${implementedBy}::${functionName}"; |
| } elsif ($attribute->isStatic) { |
| @@ -1825,7 +1837,7 @@ END |
| $code .= GenerateArgumentsCountCheck($function, $interface); |
| if ($name eq "set" and $interface->extendedAttributes->{"TypedArray"}) { |
| - AddToImplIncludes("V8ArrayBufferViewCustom.h"); |
| + AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h"); |
| $code .= <<END; |
| return setWebGLArrayHelper<$interfaceName, ${v8InterfaceName}>(args); |
| } |
| @@ -1842,7 +1854,7 @@ END |
| if ($interfaceName =~ /List$/) { |
| $code .= " $nativeClassName imp = ${v8InterfaceName}::toNative(args.Holder());\n"; |
| } else { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= " $nativeClassName wrapper = ${v8InterfaceName}::toNative(args.Holder());\n"; |
| $code .= " if (wrapper->isReadOnly())\n"; |
| $code .= " return setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n"; |
| @@ -1861,7 +1873,7 @@ END |
| # Check domain security if needed |
| if ($interface->extendedAttributes->{"CheckSecurity"} && !$function->signature->extendedAttributes->{"DoNotCheckSecurity"}) { |
| # We have not find real use cases yet. |
| - AddToImplIncludes("Frame.h"); |
| + AddToImplIncludes("core/page/Frame.h"); |
| $code .= <<END; |
| if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame())) |
| return v8Undefined(); |
| @@ -1878,7 +1890,7 @@ END |
| } |
| if ($raisesExceptions) { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= " ExceptionCode ec = 0;\n"; |
| $code .= " {\n"; |
| # The brace here is needed to prevent the ensuing 'goto fail's from jumping past constructors |
| @@ -1933,8 +1945,8 @@ sub GenerateCallWith |
| if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) { |
| $code .= $indent . "RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, " . @{$function->parameters} . "));\n"; |
| push(@callWithArgs, "scriptArguments.release()"); |
| - AddToImplIncludes("ScriptArguments.h"); |
| - AddToImplIncludes("ScriptCallStackFactory.h"); |
| + AddToImplIncludes("core/inspector/ScriptArguments.h"); |
| + AddToImplIncludes("bindings/v8/ScriptCallStackFactory.h"); |
| } |
| return ([@callWithArgs], $code); |
| } |
| @@ -2014,7 +2026,7 @@ sub GenerateParametersCheck |
| next; |
| } |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| if ($parameter->extendedAttributes->{"Callback"}) { |
| my $v8InterfaceName = "V8" . $parameter->type; |
| AddToImplIncludes("$v8InterfaceName.h"); |
| @@ -2038,7 +2050,7 @@ sub GenerateParametersCheck |
| $parameterCheckString .= " if (!std::isnan($nativeValue))\n"; |
| $parameterCheckString .= " $parameterName = clampTo<$paramType>($nativeValue);\n"; |
| } elsif ($parameter->type eq "SerializedScriptValue") { |
| - AddToImplIncludes("SerializedScriptValue.h"); |
| + AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| my $useTransferList = 0; |
| my $transferListName = ""; |
| my $TransferListName = ""; |
| @@ -2056,7 +2068,7 @@ sub GenerateParametersCheck |
| } |
| AddToImplIncludes("wtf/ArrayBuffer.h"); |
| - AddToImplIncludes("MessagePort.h"); |
| + AddToImplIncludes("core/dom/MessagePort.h"); |
| $TransferListName = ucfirst($transferListName); |
| $parameterCheckString .= " MessagePortArray messagePortArray$TransferListName;\n"; |
| $parameterCheckString .= " ArrayBufferArray arrayBufferArray$TransferListName;\n"; |
| @@ -2218,7 +2230,7 @@ END |
| } |
| if ($raisesExceptions) { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= "\n"; |
| $code .= " ExceptionCode ec = 0;\n"; |
| } |
| @@ -2340,7 +2352,7 @@ sub GenerateEventConstructor |
| my $interface = shift; |
| my $interfaceName = $interface->name; |
| - AddToImplIncludes("Dictionary.h"); |
| + AddToImplIncludes("bindings/v8/Dictionary.h"); |
| AddToImplContentInternals(<<END); |
| static v8::Handle<v8::Value> constructor(const v8::Arguments& args) |
| { |
| @@ -2399,7 +2411,7 @@ sub GenerateTypedArrayConstructor |
| my $interfaceName = $interface->name; |
| my $viewType = GetTypeNameOfExternalTypedArray($interface); |
| my $type = $interface->extendedAttributes->{"TypedArray"}; |
| - AddToImplIncludes("V8ArrayBufferViewCustom.h"); |
| + AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h"); |
| AddToImplContentInternals(<<END); |
| static v8::Handle<v8::Value> constructor(const v8::Arguments& args) |
| @@ -2444,7 +2456,7 @@ sub GenerateNamedConstructor |
| $toEventTarget = "${v8InterfaceName}::toEventTarget"; |
| } |
| - AddToImplIncludes("Frame.h"); |
| + AddToImplIncludes("core/page/Frame.h"); |
| AddToImplContent(<<END); |
| WrapperTypeInfo ${v8InterfaceName}Constructor::info = { ${v8InterfaceName}Constructor::GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObject, $toEventTarget, 0, ${v8InterfaceName}::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype }; |
| @@ -2470,7 +2482,7 @@ END |
| $code .= GenerateArgumentsCountCheck($function, $interface); |
| if ($raisesExceptions) { |
| - AddToImplIncludes("ExceptionCode.h"); |
| + AddToImplIncludes("core/dom/ExceptionCode.h"); |
| $code .= "\n"; |
| $code .= " ExceptionCode ec = 0;\n"; |
| } |
| @@ -2632,7 +2644,11 @@ sub GenerateSingleBatchedAttribute |
| # We do not generate the header file for NamedConstructor of class XXXX, |
| # since we generate the NamedConstructor declaration into the header file of class XXXX. |
| if ($constructorType !~ /Constructor$/ || $attribute->signature->extendedAttributes->{"CustomConstructor"}) { |
| - AddToImplIncludes("V8${constructorType}.h", $attribute->signature->extendedAttributes->{"Conditional"}); |
| + my $includepath = ""; |
| + if ($constructorType eq "HTMLImageElementConstructor") { |
| + $includepath = "bindings/v8/custom/"; |
| + } |
| + AddToImplIncludes("${includepath}V8${constructorType}.h", $attribute->signature->extendedAttributes->{"Conditional"}); |
| } |
| $data = "&V8${constructorType}::info"; |
| $getter = "${interfaceName}V8Internal::${interfaceName}ConstructorGetter"; |
| @@ -2817,7 +2833,7 @@ sub GenerateImplementationIndexedProperty |
| return ""; |
| } |
| - AddToImplIncludes("V8Collection.h"); |
| + AddToImplIncludes("bindings/v8/V8Collection.h"); |
| if (!$indexer) { |
| $indexer = $codeGenerator->FindSuperMethod($interface, "item"); |
| @@ -2905,7 +2921,7 @@ sub GenerateImplementationNamedPropertyGetter |
| if ($interface->extendedAttributes->{"NamedGetter"}) { |
| die "$interfaceName: [NamedGetter] but no namedItem() method." if (!$namedPropertyGetter); |
| - AddToImplIncludes("V8Collection.h"); |
| + AddToImplIncludes("bindings/v8/V8Collection.h"); |
| my $type = $namedPropertyGetter->type; |
| $subCode .= <<END; |
| desc->InstanceTemplate()->SetNamedPropertyHandler(${v8InterfaceName}::namedPropertyGetter, 0, 0, 0, 0); |
| @@ -3016,11 +3032,11 @@ sub GenerateImplementation |
| # - Add default header template |
| push(@implContentHeader, GenerateImplementationContentHeader($interface)); |
| - AddToImplIncludes("BindingState.h"); |
| - AddToImplIncludes("ContextFeatures.h"); |
| - AddToImplIncludes("RuntimeEnabledFeatures.h"); |
| - AddToImplIncludes("V8Binding.h"); |
| - AddToImplIncludes("V8DOMWrapper.h"); |
| + AddToImplIncludes("bindings/v8/BindingState.h"); |
| + AddToImplIncludes("core/dom/ContextFeatures.h"); |
| + AddToImplIncludes("core/page/RuntimeEnabledFeatures.h"); |
| + AddToImplIncludes("bindings/v8/V8Binding.h"); |
| + AddToImplIncludes("bindings/v8/V8DOMWrapper.h"); |
| AddIncludesForType($interfaceName); |
| @@ -3136,7 +3152,7 @@ END |
| } |
| if ($attrType eq "SerializedScriptValue") { |
| - AddToImplIncludes("SerializedScriptValue.h"); |
| + AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| } |
| GenerateNormalAttrGetter($attribute, $interface, ""); |
| @@ -3329,7 +3345,8 @@ END |
| my $conditional = $attrExt->{"Conditional"}; |
| my $implementedBy = $attrExt->{"ImplementedBy"}; |
| if ($implementedBy) { |
| - AddToImplIncludes("${implementedBy}.h"); |
| + my $implementedByPath = idlToPath($implementedBy); |
| + AddToImplIncludes("${implementedByPath}${implementedBy}.h"); |
| } |
| if ($attrExt->{"EnabledAtRuntime"}) { |
| push(@constantsEnabledAtRuntime, $constant); |
| @@ -3764,10 +3781,11 @@ sub GenerateCallbackHeader |
| AddToHeader(GenerateHeaderContentHeader($interface)); |
| my @unsortedIncludes = (); |
| - push(@unsortedIncludes, "#include \"ActiveDOMCallback.h\""); |
| - push(@unsortedIncludes, "#include \"DOMWrapperWorld.h\""); |
| - push(@unsortedIncludes, "#include \"$interfaceName.h\""); |
| - push(@unsortedIncludes, "#include \"ScopedPersistent.h\""); |
| + push(@unsortedIncludes, "#include \"bindings/v8/ActiveDOMCallback.h\""); |
| + push(@unsortedIncludes, "#include \"bindings/v8/DOMWrapperWorld.h\""); |
| + my $interfacePath = idlToPath($interfaceName); |
| + push(@unsortedIncludes, "#include \"$interfacePath$interfaceName.h\""); |
| + push(@unsortedIncludes, "#include \"bindings/v8/ScopedPersistent.h\""); |
| push(@unsortedIncludes, "#include <v8.h>"); |
| push(@unsortedIncludes, "#include <wtf/Forward.h>"); |
| AddToHeader(join("\n", sort @unsortedIncludes)); |
| @@ -3841,9 +3859,9 @@ sub GenerateCallbackImplementation |
| # - Add default header template |
| push(@implContentHeader, GenerateImplementationContentHeader($interface)); |
| - AddToImplIncludes("ScriptExecutionContext.h"); |
| - AddToImplIncludes("V8Binding.h"); |
| - AddToImplIncludes("V8Callback.h"); |
| + AddToImplIncludes("core/dom/ScriptExecutionContext.h"); |
| + AddToImplIncludes("bindings/v8/V8Binding.h"); |
| + AddToImplIncludes("bindings/v8/V8Callback.h"); |
| AddToImplContent("#include <wtf/Assertions.h>\n\n"); |
| AddToImplContent("namespace WebCore {\n\n"); |
| @@ -3954,7 +3972,7 @@ sub GenerateToV8Converters |
| return; |
| } |
| - AddToImplIncludes("Frame.h"); |
| + AddToImplIncludes("core/page/Frame.h"); |
| AddToImplIncludes("ScriptController.h"); |
| my $createWrapperArgumentType = GetPassRefPtrType($nativeType); |
| @@ -4180,7 +4198,8 @@ sub GenerateFunctionCallString |
| my $functionName; |
| my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; |
| if ($implementedBy) { |
| - AddToImplIncludes("${implementedBy}.h"); |
| + my $implementedByPath = idlToPath($implementedBy); |
| + AddToImplIncludes("${implementedByPath}${implementedBy}.h"); |
| unshift(@arguments, "imp") if !$function->isStatic; |
| $functionName = "${implementedBy}::${name}"; |
| } elsif ($function->isStatic) { |
| @@ -4257,7 +4276,7 @@ sub GenerateFunctionCallString |
| if ($isSVGTearOffType) { |
| AddToImplIncludes("V8$returnType.h"); |
| - AddToImplIncludes("SVGPropertyTearOff.h"); |
| + AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h"); |
| my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType); |
| # FIXME: Update for all ScriptWrappables. |
| if (IsDOMNodeType($interfaceName)) { |
| @@ -4385,7 +4404,7 @@ sub TypeCanFailConversion |
| my $signature = shift; |
| my $type = $signature->type; |
| - AddToImplIncludes("ExceptionCode.h") if $type eq "Attr"; |
| + AddToImplIncludes("core/dom/ExceptionCode.h") if $type eq "Attr"; |
| return 1 if $type eq "Attr"; |
| return 0; |
| } |
| @@ -4427,17 +4446,17 @@ sub JSValueToNative |
| } |
| if ($type eq "SerializedScriptValue") { |
| - AddToImplIncludes("SerializedScriptValue.h"); |
| + AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| return "SerializedScriptValue::create($value, $getIsolate)"; |
| } |
| if ($type eq "Dictionary") { |
| - AddToImplIncludes("Dictionary.h"); |
| + AddToImplIncludes("bindings/v8/Dictionary.h"); |
| return "Dictionary($value, $getIsolate)"; |
| } |
| if ($type eq "any") { |
| - AddToImplIncludes("ScriptValue.h"); |
| + AddToImplIncludes("bindings/v8/ScriptValue.h"); |
| return "ScriptValue($value)"; |
| } |
| @@ -4446,7 +4465,7 @@ sub JSValueToNative |
| } |
| if ($type eq "MediaQueryListListener") { |
| - AddToImplIncludes("MediaQueryListListener.h"); |
| + AddToImplIncludes("core/css/MediaQueryListListener.h"); |
| return "MediaQueryListListener::create(" . $value . ")"; |
| } |
| @@ -4480,9 +4499,10 @@ sub GetV8HeaderName |
| { |
| my $type = shift; |
| return "V8Event.h" if $type eq "DOMTimeStamp"; |
| - return "EventListener.h" if $type eq "EventListener"; |
| - return "SerializedScriptValue.h" if $type eq "SerializedScriptValue"; |
| - return "ScriptValue.h" if $type eq "any"; |
| + return "core/dom/EventListener.h" if $type eq "EventListener"; |
| + return "bindings/v8/SerializedScriptValue.h" if $type eq "SerializedScriptValue"; |
| + return "bindings/v8/ScriptValue.h" if $type eq "any"; |
| + return "bindings/v8/V8GCController.h" if $type eq "GCController"; |
| return "V8${type}.h"; |
| } |
| @@ -4512,7 +4532,7 @@ sub CreateCustomSignature |
| if ($arrayOrSequenceType) { |
| if ($arrayType eq "DOMString") { |
| AddToImplIncludes("V8DOMStringList.h"); |
| - AddToImplIncludes("DOMStringList.h"); |
| + AddToImplIncludes("core/dom/DOMStringList.h"); |
| } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { |
| AddToImplIncludes(GetV8HeaderName($arrayOrSequenceType)); |
| @@ -4713,11 +4733,12 @@ sub NativeToJSValue |
| if ($arrayOrSequenceType) { |
| if ($arrayType eq "DOMString") { |
| AddToImplIncludes("V8DOMStringList.h"); |
| - AddToImplIncludes("DOMStringList.h"); |
| + AddToImplIncludes("core/dom/DOMStringList.h"); |
| } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { |
| AddToImplIncludes(GetV8HeaderName($arrayOrSequenceType)); |
| - AddToImplIncludes("${arrayOrSequenceType}.h"); |
| + my $includepath = idlToPath($arrayOrSequenceType); # This is not an arraytype (always?). It's things like ScriptProfileNode, MediaStreamTream, MediaStreamTream, MediaStream. |
| + AddToImplIncludes("${includepath}${arrayOrSequenceType}.h"); |
| } |
| return "v8Array($value, $getIsolate)"; |
| } |
| @@ -4732,7 +4753,7 @@ sub NativeToJSValue |
| } |
| if ($type eq "EventListener") { |
| - AddToImplIncludes("V8AbstractEventListener.h"); |
| + AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8Null($getIsolate))"; |
| } |