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

Unified Diff: Source/bindings/scripts/CodeGeneratorV8.pm

Issue 14456006: Fixes to make scripts generate includes with paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/CodeGeneratorV8.pm
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
index 5ecf344c1e37fbba8a55317ea5aaf65a60004362..c292928924ae606ca02fafde38a84b44b3788556 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;
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;
@@ -683,6 +685,13 @@ sub GetInternalFields
return @customInternalFields;
}
+sub mapInterfaceToIncludePath
+{
+ my $interface = shift;
+
+ return idlToPath($interface);
+}
+
sub GetHeaderClassInclude
{
my $v8InterfaceName = shift;
@@ -691,7 +700,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
@@ -876,7 +886,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)
{
@@ -1139,7 +1149,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";
}
@@ -1156,7 +1166,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) {
@@ -1222,7 +1233,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";
@@ -1258,7 +1269,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"}) {
@@ -1270,7 +1281,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") {
@@ -1353,7 +1364,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()))
@@ -1379,7 +1390,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;
@@ -1465,7 +1476,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";
@@ -1549,7 +1560,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";
}
@@ -1558,16 +1569,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)";
@@ -1580,7 +1591,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) {
@@ -1829,7 +1841,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);
}
@@ -1846,7 +1858,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";
@@ -1865,7 +1877,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();
@@ -1882,7 +1894,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
@@ -1937,8 +1949,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);
}
@@ -2018,7 +2030,7 @@ sub GenerateParametersCheck
next;
}
- AddToImplIncludes("ExceptionCode.h");
+ AddToImplIncludes("core/dom/ExceptionCode.h");
if ($parameter->extendedAttributes->{"Callback"}) {
my $v8InterfaceName = "V8" . $parameter->type;
AddToImplIncludes("$v8InterfaceName.h");
@@ -2042,7 +2054,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 = "";
@@ -2060,7 +2072,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";
@@ -2222,7 +2234,7 @@ END
}
if ($raisesExceptions) {
- AddToImplIncludes("ExceptionCode.h");
+ AddToImplIncludes("core/dom/ExceptionCode.h");
$code .= "\n";
$code .= " ExceptionCode ec = 0;\n";
}
@@ -2344,7 +2356,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)
{
@@ -2403,7 +2415,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)
@@ -2448,7 +2460,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 };
@@ -2474,7 +2486,7 @@ END
$code .= GenerateArgumentsCountCheck($function, $interface);
if ($raisesExceptions) {
- AddToImplIncludes("ExceptionCode.h");
+ AddToImplIncludes("core/dom/ExceptionCode.h");
$code .= "\n";
$code .= " ExceptionCode ec = 0;\n";
}
@@ -2636,7 +2648,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";
@@ -2821,7 +2837,7 @@ sub GenerateImplementationIndexedProperty
return "";
}
- AddToImplIncludes("V8Collection.h");
+ AddToImplIncludes("bindings/v8/V8Collection.h");
if (!$indexer) {
$indexer = $codeGenerator->FindSuperMethod($interface, "item");
@@ -2909,7 +2925,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);
@@ -3020,11 +3036,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);
@@ -3140,7 +3156,7 @@ END
}
if ($attrType eq "SerializedScriptValue") {
- AddToImplIncludes("SerializedScriptValue.h");
+ AddToImplIncludes("bindings/v8/SerializedScriptValue.h");
}
GenerateNormalAttrGetter($attribute, $interface, "");
@@ -3333,7 +3349,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);
@@ -3768,10 +3785,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));
@@ -3845,9 +3863,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");
@@ -3958,7 +3976,7 @@ sub GenerateToV8Converters
return;
}
- AddToImplIncludes("Frame.h");
+ AddToImplIncludes("core/page/Frame.h");
AddToImplIncludes("ScriptController.h");
my $createWrapperArgumentType = GetPassRefPtrType($nativeType);
@@ -4184,7 +4202,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) {
@@ -4261,7 +4280,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)) {
@@ -4389,7 +4408,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;
}
@@ -4431,17 +4450,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)";
}
@@ -4450,7 +4469,7 @@ sub JSValueToNative
}
if ($type eq "MediaQueryListListener") {
- AddToImplIncludes("MediaQueryListListener.h");
+ AddToImplIncludes("core/css/MediaQueryListListener.h");
return "MediaQueryListListener::create(" . $value . ")";
}
@@ -4484,9 +4503,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";
}
@@ -4516,7 +4536,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));
@@ -4717,11 +4737,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)";
}
@@ -4736,7 +4757,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))";
}

Powered by Google App Engine
This is Rietveld 408576698