| OLD | NEW |
| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 void* V8${interfaceName}::opaqueRootForGC(void* object, v8::Persistent<v8::Objec
t> wrapper, v8::Isolate* isolate) | 214 void* V8${interfaceName}::opaqueRootForGC(void* object, v8::Persistent<v8::Objec
t> wrapper, v8::Isolate* isolate) |
| 215 { | 215 { |
| 216 ASSERT(!wrapper.IsIndependent(isolate)); | 216 ASSERT(!wrapper.IsIndependent(isolate)); |
| 217 ${interfaceName}* impl = static_cast<${interfaceName}*>(object); | 217 ${interfaceName}* impl = static_cast<${interfaceName}*>(object); |
| 218 END | 218 END |
| 219 if (GetGenerateIsReachable($interface) eq "ImplDocument" || | 219 if (GetGenerateIsReachable($interface) eq "ImplDocument" || |
| 220 GetGenerateIsReachable($interface) eq "ImplElementRoot" || | 220 GetGenerateIsReachable($interface) eq "ImplElementRoot" || |
| 221 GetGenerateIsReachable($interface) eq "ImplOwnerRoot" || | 221 GetGenerateIsReachable($interface) eq "ImplOwnerRoot" || |
| 222 GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { | 222 GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { |
| 223 | 223 |
| 224 $implIncludes{"V8GCController.h"} = 1; | 224 $implIncludes{"bindings/v8/V8GCController.h"} = 1; |
| 225 | 225 |
| 226 my $methodName; | 226 my $methodName; |
| 227 $methodName = "document" if (GetGenerateIsReachable($interface) eq "Impl
Document"); | 227 $methodName = "document" if (GetGenerateIsReachable($interface) eq "Impl
Document"); |
| 228 $methodName = "element" if (GetGenerateIsReachable($interface) eq "ImplE
lementRoot"); | 228 $methodName = "element" if (GetGenerateIsReachable($interface) eq "ImplE
lementRoot"); |
| 229 $methodName = "owner" if (GetGenerateIsReachable($interface) eq "ImplOwn
erRoot"); | 229 $methodName = "owner" if (GetGenerateIsReachable($interface) eq "ImplOwn
erRoot"); |
| 230 $methodName = "ownerNode" if (GetGenerateIsReachable($interface) eq "Imp
lOwnerNodeRoot"); | 230 $methodName = "ownerNode" if (GetGenerateIsReachable($interface) eq "Imp
lOwnerNodeRoot"); |
| 231 | 231 |
| 232 $code .= <<END; | 232 $code .= <<END; |
| 233 if (Node* owner = impl->${methodName}()) | 233 if (Node* owner = impl->${methodName}()) |
| 234 return V8GCController::opaqueRootForGC(owner, isolate); | 234 return V8GCController::opaqueRootForGC(owner, isolate); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (!$hasDependentLifetime) { | 303 if (!$hasDependentLifetime) { |
| 304 foreach (@{$interface->parents}) { | 304 foreach (@{$interface->parents}) { |
| 305 my $parent = $_; | 305 my $parent = $_; |
| 306 $headerIncludes{"V8${parent}.h"} = 1; | 306 $headerIncludes{"V8${parent}.h"} = 1; |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 # - Add default header template | 310 # - Add default header template |
| 311 AddToHeader(GenerateHeaderContentHeader($interface)); | 311 AddToHeader(GenerateHeaderContentHeader($interface)); |
| 312 | 312 |
| 313 $headerIncludes{"bindings/v8/WrapperTypeInfo.h"} = 1; |
| 314 $headerIncludes{"bindings/v8/V8Binding.h"} = 1; |
| 315 $headerIncludes{"bindings/v8/V8DOMWrapper.h"} = 1; |
| 316 $headerIncludes{"v8.h"} = 1; |
| 317 $headerIncludes{"wtf/HashMap.h"} = 1; |
| 313 $headerIncludes{"wtf/text/StringHash.h"} = 1; | 318 $headerIncludes{"wtf/text/StringHash.h"} = 1; |
| 314 $headerIncludes{"WrapperTypeInfo.h"} = 1; | |
| 315 $headerIncludes{"V8Binding.h"} = 1; | |
| 316 $headerIncludes{"V8DOMWrapper.h"} = 1; | |
| 317 $headerIncludes{"wtf/HashMap.h"} = 1; | |
| 318 $headerIncludes{"v8.h"} = 1; | |
| 319 | 319 |
| 320 my $headerClassInclude = GetHeaderClassInclude($interfaceName); | 320 my $headerClassInclude = GetHeaderClassInclude($interfaceName); |
| 321 $headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne ""; | 321 $headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne ""; |
| 322 | 322 |
| 323 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); | 323 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); |
| 324 | 324 |
| 325 foreach my $headerInclude (sort keys(%headerIncludes)) { | 325 foreach my $headerInclude (sort keys(%headerIncludes)) { |
| 326 if ($headerInclude =~ /wtf|v8\.h/) { | 326 if ($headerInclude =~ /wtf|v8\.h/) { |
| 327 AddToHeader("#include \<${headerInclude}\>\n"); | 327 AddToHeader("#include \<${headerInclude}\>\n"); |
| 328 } else { | 328 } else { |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 984 } |
| 985 | 985 |
| 986 sub GenerateActivityLogging | 986 sub GenerateActivityLogging |
| 987 { | 987 { |
| 988 my $accessType = shift; | 988 my $accessType = shift; |
| 989 my $interface = shift; | 989 my $interface = shift; |
| 990 my $propertyName = shift; | 990 my $propertyName = shift; |
| 991 | 991 |
| 992 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interfac
e); | 992 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interfac
e); |
| 993 | 993 |
| 994 AddToImplIncludes("V8Binding.h"); | 994 AddToImplIncludes("bindings/v8/V8Binding.h"); |
| 995 AddToImplIncludes("V8DOMActivityLogger.h"); | 995 AddToImplIncludes("bindings/v8/V8DOMActivityLogger.h"); |
| 996 AddToImplIncludes("wtf/Vector.h"); | 996 AddToImplIncludes("wtf/Vector.h"); |
| 997 | 997 |
| 998 my $code = ""; | 998 my $code = ""; |
| 999 if ($accessType eq "Method") { | 999 if ($accessType eq "Method") { |
| 1000 $code .= <<END; | 1000 $code .= <<END; |
| 1001 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | 1001 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); |
| 1002 if (contextData && contextData->activityLogger()) { | 1002 if (contextData && contextData->activityLogger()) { |
| 1003 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | 1003 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); |
| 1004 contextData->activityLogger()->log("${visibleInterfaceName}.${propertyNa
me}", args.Length(), loggerArgs.data(), "${accessType}"); | 1004 contextData->activityLogger()->log("${visibleInterfaceName}.${propertyNa
me}", args.Length(), loggerArgs.data(), "${accessType}"); |
| 1005 } | 1005 } |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 if ($useExceptions) { | 1568 if ($useExceptions) { |
| 1569 AddToImplIncludes("core/dom/ExceptionCode.h"); | 1569 AddToImplIncludes("core/dom/ExceptionCode.h"); |
| 1570 $code .= " ExceptionCode ec = 0;\n"; | 1570 $code .= " ExceptionCode ec = 0;\n"; |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 if ($interfaceName eq "SVGNumber") { | 1573 if ($interfaceName eq "SVGNumber") { |
| 1574 $code .= " *imp = $expression;\n"; | 1574 $code .= " *imp = $expression;\n"; |
| 1575 } else { | 1575 } else { |
| 1576 if ($attribute->signature->type eq "EventListener") { | 1576 if ($attribute->signature->type eq "EventListener") { |
| 1577 my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName); | 1577 my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName); |
| 1578 AddToImplIncludes("V8AbstractEventListener.h"); | 1578 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| 1579 if (!$codeGenerator->InheritsInterface($interface, "Node")) { | 1579 if (!$codeGenerator->InheritsInterface($interface, "Node")) { |
| 1580 $code .= " transferHiddenDependency(info.Holder(), imp->$attr
Name(), value, ${v8InterfaceName}::eventListenerCacheIndex, info.GetIsolate());\
n"; | 1580 $code .= " transferHiddenDependency(info.Holder(), imp->$attr
Name(), value, ${v8InterfaceName}::eventListenerCacheIndex, info.GetIsolate());\
n"; |
| 1581 } | 1581 } |
| 1582 AddToImplIncludes("V8EventListenerList.h"); | 1582 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| 1583 if ($interfaceName eq "WorkerContext" and $attribute->signature->nam
e eq "onerror") { | 1583 if ($interfaceName eq "WorkerContext" and $attribute->signature->nam
e eq "onerror") { |
| 1584 AddToImplIncludes("V8WorkerContextErrorHandler.h"); | 1584 AddToImplIncludes("bindings/v8/V8WorkerContextErrorHandler.h"); |
| 1585 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)"; | 1585 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)"; |
| 1586 } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->na
me eq "onerror") { | 1586 } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->na
me eq "onerror") { |
| 1587 AddToImplIncludes("V8WindowErrorHandler.h"); | 1587 AddToImplIncludes("V8WindowErrorHandler.h"); |
| 1588 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8WindowErrorHandler>(value, true)"; | 1588 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8WindowErrorHandler>(value, true)"; |
| 1589 } else { | 1589 } else { |
| 1590 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::getEventListener(value, true, ListenerFindOrCreate)"; | 1590 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::getEventListener(value, true, ListenerFindOrCreate)"; |
| 1591 } | 1591 } |
| 1592 $code .= ", ec" if $useExceptions; | 1592 $code .= ", ec" if $useExceptions; |
| 1593 $code .= ");\n"; | 1593 $code .= ");\n"; |
| 1594 } else { | 1594 } else { |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 my $code = ""; | 1831 my $code = ""; |
| 1832 $code .= "#if ${conditionalString}\n\n" if $conditionalString; | 1832 $code .= "#if ${conditionalString}\n\n" if $conditionalString; |
| 1833 $code .= "static v8::Handle<v8::Value> ${name}Method${forMainWorldSuffix}(co
nst v8::Arguments& args)\n"; | 1833 $code .= "static v8::Handle<v8::Value> ${name}Method${forMainWorldSuffix}(co
nst v8::Arguments& args)\n"; |
| 1834 $code .= "{\n"; | 1834 $code .= "{\n"; |
| 1835 | 1835 |
| 1836 if ($name eq "addEventListener" || $name eq "removeEventListener") { | 1836 if ($name eq "addEventListener" || $name eq "removeEventListener") { |
| 1837 my $lookupType = ($name eq "addEventListener") ? "OrCreate" : "Only"; | 1837 my $lookupType = ($name eq "addEventListener") ? "OrCreate" : "Only"; |
| 1838 my $passRefPtrHandling = ($name eq "addEventListener") ? "" : ".get()"; | 1838 my $passRefPtrHandling = ($name eq "addEventListener") ? "" : ".get()"; |
| 1839 my $hiddenDependencyAction = ($name eq "addEventListener") ? "create" :
"remove"; | 1839 my $hiddenDependencyAction = ($name eq "addEventListener") ? "create" :
"remove"; |
| 1840 | 1840 |
| 1841 AddToImplIncludes("V8EventListenerList.h"); | 1841 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| 1842 $code .= <<END; | 1842 $code .= <<END; |
| 1843 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFind${lookupType}); | 1843 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFind${lookupType}); |
| 1844 if (listener) { | 1844 if (listener) { |
| 1845 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | 1845 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); |
| 1846 V8${interfaceName}::toNative(args.Holder())->${name}(stringResource, lis
tener${passRefPtrHandling}, args[2]->BooleanValue()); | 1846 V8${interfaceName}::toNative(args.Holder())->${name}(stringResource, lis
tener${passRefPtrHandling}, args[2]->BooleanValue()); |
| 1847 END | 1847 END |
| 1848 if (!$codeGenerator->InheritsInterface($interface, "Node")) { | 1848 if (!$codeGenerator->InheritsInterface($interface, "Node")) { |
| 1849 $code .= <<END; | 1849 $code .= <<END; |
| 1850 ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${in
terfaceName}::eventListenerCacheIndex, args.GetIsolate()); | 1850 ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${in
terfaceName}::eventListenerCacheIndex, args.GetIsolate()); |
| 1851 END | 1851 END |
| 1852 } | 1852 } |
| 1853 $code .= <<END; | 1853 $code .= <<END; |
| 1854 } | 1854 } |
| 1855 return v8Undefined(); | 1855 return v8Undefined(); |
| 1856 } | 1856 } |
| 1857 | 1857 |
| 1858 END | 1858 END |
| 1859 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; | 1859 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; |
| 1860 AddToImplContentInternals($code); | 1860 AddToImplContentInternals($code); |
| 1861 return; | 1861 return; |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 $code .= GenerateArgumentsCountCheck($function, $interface); | 1864 $code .= GenerateArgumentsCountCheck($function, $interface); |
| 1865 | 1865 |
| 1866 if ($name eq "set" and $interface->extendedAttributes->{"TypedArray"}) { | 1866 if ($name eq "set" and $interface->extendedAttributes->{"TypedArray"}) { |
| 1867 AddToImplIncludes("V8ArrayBufferViewCustom.h"); | 1867 AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h"); |
| 1868 $code .= <<END; | 1868 $code .= <<END; |
| 1869 return setWebGLArrayHelper<$interfaceName, ${v8InterfaceName}>(args); | 1869 return setWebGLArrayHelper<$interfaceName, ${v8InterfaceName}>(args); |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 END | 1872 END |
| 1873 AddToImplContentInternals($code); | 1873 AddToImplContentInternals($code); |
| 1874 return; | 1874 return; |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); | 1877 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 $code .= $indent . "ScriptState& state = *currentState;\n"; | 1965 $code .= $indent . "ScriptState& state = *currentState;\n"; |
| 1966 push(@callWithArgs, "&state"); | 1966 push(@callWithArgs, "&state"); |
| 1967 } | 1967 } |
| 1968 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionCon
text")) { | 1968 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionCon
text")) { |
| 1969 $code .= $indent . "ScriptExecutionContext* scriptContext = getScriptExe
cutionContext();\n"; | 1969 $code .= $indent . "ScriptExecutionContext* scriptContext = getScriptExe
cutionContext();\n"; |
| 1970 push(@callWithArgs, "scriptContext"); | 1970 push(@callWithArgs, "scriptContext"); |
| 1971 } | 1971 } |
| 1972 if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "Scri
ptArguments")) { | 1972 if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "Scri
ptArguments")) { |
| 1973 $code .= $indent . "RefPtr<ScriptArguments> scriptArguments(createScript
Arguments(args, " . @{$function->parameters} . "));\n"; | 1973 $code .= $indent . "RefPtr<ScriptArguments> scriptArguments(createScript
Arguments(args, " . @{$function->parameters} . "));\n"; |
| 1974 push(@callWithArgs, "scriptArguments.release()"); | 1974 push(@callWithArgs, "scriptArguments.release()"); |
| 1975 AddToImplIncludes("ScriptArguments.h"); | 1975 AddToImplIncludes("bindings/v8/ScriptCallStackFactory.h"); |
| 1976 AddToImplIncludes("ScriptCallStackFactory.h"); | 1976 AddToImplIncludes("core/inspector/ScriptArguments.h"); |
| 1977 } | 1977 } |
| 1978 return ([@callWithArgs], $code); | 1978 return ([@callWithArgs], $code); |
| 1979 } | 1979 } |
| 1980 | 1980 |
| 1981 sub GenerateArgumentsCountCheck | 1981 sub GenerateArgumentsCountCheck |
| 1982 { | 1982 { |
| 1983 my $function = shift; | 1983 my $function = shift; |
| 1984 my $interface = shift; | 1984 my $interface = shift; |
| 1985 | 1985 |
| 1986 my $numMandatoryParams = 0; | 1986 my $numMandatoryParams = 0; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2070 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $
parameterName = ${v8InterfaceName}::create(args[$paramIndex], getScriptExecution
Context());\n"; | 2070 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $
parameterName = ${v8InterfaceName}::create(args[$paramIndex], getScriptExecution
Context());\n"; |
| 2071 } | 2071 } |
| 2072 } elsif ($parameter->extendedAttributes->{"Clamp"}) { | 2072 } elsif ($parameter->extendedAttributes->{"Clamp"}) { |
| 2073 my $nativeValue = "${parameterName}NativeValue"; | 2073 my $nativeValue = "${parameterName}NativeValue"; |
| 2074 my $paramType = $parameter->type; | 2074 my $paramType = $parameter->type; |
| 2075 $parameterCheckString .= " $paramType $parameterName = 0;\n"; | 2075 $parameterCheckString .= " $paramType $parameterName = 0;\n"; |
| 2076 $parameterCheckString .= " V8TRYCATCH(double, $nativeValue, a
rgs[$paramIndex]->NumberValue());\n"; | 2076 $parameterCheckString .= " V8TRYCATCH(double, $nativeValue, a
rgs[$paramIndex]->NumberValue());\n"; |
| 2077 $parameterCheckString .= " if (!std::isnan($nativeValue))\n"; | 2077 $parameterCheckString .= " if (!std::isnan($nativeValue))\n"; |
| 2078 $parameterCheckString .= " $parameterName = clampTo<$para
mType>($nativeValue);\n"; | 2078 $parameterCheckString .= " $parameterName = clampTo<$para
mType>($nativeValue);\n"; |
| 2079 } elsif ($parameter->type eq "SerializedScriptValue") { | 2079 } elsif ($parameter->type eq "SerializedScriptValue") { |
| 2080 AddToImplIncludes("SerializedScriptValue.h"); | 2080 AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| 2081 my $useTransferList = 0; | 2081 my $useTransferList = 0; |
| 2082 my $transferListName = ""; | 2082 my $transferListName = ""; |
| 2083 my $TransferListName = ""; | 2083 my $TransferListName = ""; |
| 2084 if ($parameter->extendedAttributes->{"TransferList"}) { | 2084 if ($parameter->extendedAttributes->{"TransferList"}) { |
| 2085 $transferListName = $parameter->extendedAttributes->{"TransferLi
st"}; | 2085 $transferListName = $parameter->extendedAttributes->{"TransferLi
st"}; |
| 2086 push(@paramTransferListNames, $transferListName); | 2086 push(@paramTransferListNames, $transferListName); |
| 2087 | 2087 |
| 2088 my @allParameterNames = (); | 2088 my @allParameterNames = (); |
| 2089 foreach my $parameter (@{$function->parameters}) { | 2089 foreach my $parameter (@{$function->parameters}) { |
| 2090 push(@allParameterNames, $parameter->name); | 2090 push(@allParameterNames, $parameter->name); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2373 } | 2373 } |
| 2374 GenerateOverloadedConstructorCallback($interface); | 2374 GenerateOverloadedConstructorCallback($interface); |
| 2375 } | 2375 } |
| 2376 } | 2376 } |
| 2377 | 2377 |
| 2378 sub GenerateEventConstructor | 2378 sub GenerateEventConstructor |
| 2379 { | 2379 { |
| 2380 my $interface = shift; | 2380 my $interface = shift; |
| 2381 my $interfaceName = $interface->name; | 2381 my $interfaceName = $interface->name; |
| 2382 | 2382 |
| 2383 AddToImplIncludes("Dictionary.h"); | 2383 AddToImplIncludes("bindings/v8/Dictionary.h"); |
| 2384 AddToImplContentInternals(<<END); | 2384 AddToImplContentInternals(<<END); |
| 2385 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | 2385 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) |
| 2386 { | 2386 { |
| 2387 if (args.Length() < 1) | 2387 if (args.Length() < 1) |
| 2388 return throwNotEnoughArgumentsError(args.GetIsolate()); | 2388 return throwNotEnoughArgumentsError(args.GetIsolate()); |
| 2389 | 2389 |
| 2390 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); | 2390 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); |
| 2391 ${interfaceName}Init eventInit; | 2391 ${interfaceName}Init eventInit; |
| 2392 if (args.Length() >= 2) { | 2392 if (args.Length() >= 2) { |
| 2393 V8TRYCATCH(Dictionary, options, Dictionary(args[1], args.GetIsolate())); | 2393 V8TRYCATCH(Dictionary, options, Dictionary(args[1], args.GetIsolate())); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 END | 2432 END |
| 2433 AddToImplContent($code); | 2433 AddToImplContent($code); |
| 2434 } | 2434 } |
| 2435 | 2435 |
| 2436 sub GenerateTypedArrayConstructor | 2436 sub GenerateTypedArrayConstructor |
| 2437 { | 2437 { |
| 2438 my $interface = shift; | 2438 my $interface = shift; |
| 2439 my $interfaceName = $interface->name; | 2439 my $interfaceName = $interface->name; |
| 2440 my $viewType = GetTypeNameOfExternalTypedArray($interface); | 2440 my $viewType = GetTypeNameOfExternalTypedArray($interface); |
| 2441 my $type = $interface->extendedAttributes->{"TypedArray"}; | 2441 my $type = $interface->extendedAttributes->{"TypedArray"}; |
| 2442 AddToImplIncludes("V8ArrayBufferViewCustom.h"); | 2442 AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h"); |
| 2443 | 2443 |
| 2444 AddToImplContentInternals(<<END); | 2444 AddToImplContentInternals(<<END); |
| 2445 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | 2445 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) |
| 2446 { | 2446 { |
| 2447 return constructWebGLArray<$interfaceName, V8${interfaceName}, $type>(args,
&V8${interfaceName}::info, $viewType); | 2447 return constructWebGLArray<$interfaceName, V8${interfaceName}, $type>(args,
&V8${interfaceName}::info, $viewType); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 END | 2450 END |
| 2451 } | 2451 } |
| 2452 | 2452 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2858 # FIXME: Find a way to not have to special-case HTMLOptionsCollection. | 2858 # FIXME: Find a way to not have to special-case HTMLOptionsCollection. |
| 2859 if ($interfaceName eq "HTMLOptionsCollection") { | 2859 if ($interfaceName eq "HTMLOptionsCollection") { |
| 2860 $hasEnumerator = 1; | 2860 $hasEnumerator = 1; |
| 2861 $hasIndexedGetter = 1; | 2861 $hasIndexedGetter = 1; |
| 2862 } | 2862 } |
| 2863 | 2863 |
| 2864 if (!$hasIndexedGetter) { | 2864 if (!$hasIndexedGetter) { |
| 2865 return ""; | 2865 return ""; |
| 2866 } | 2866 } |
| 2867 | 2867 |
| 2868 AddToImplIncludes("V8Collection.h"); | 2868 AddToImplIncludes("bindings/v8/V8Collection.h"); |
| 2869 | 2869 |
| 2870 if (!$indexer) { | 2870 if (!$indexer) { |
| 2871 $indexer = $codeGenerator->FindSuperMethod($interface, "item"); | 2871 $indexer = $codeGenerator->FindSuperMethod($interface, "item"); |
| 2872 } | 2872 } |
| 2873 | 2873 |
| 2874 my $indexerType = $indexer ? $indexer->type : 0; | 2874 my $indexerType = $indexer ? $indexer->type : 0; |
| 2875 | 2875 |
| 2876 if ($indexerType && !$hasCustomIndexedSetter) { | 2876 if ($indexerType && !$hasCustomIndexedSetter) { |
| 2877 $hasEnumerator = 1; | 2877 $hasEnumerator = 1; |
| 2878 } | 2878 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 | 2946 |
| 2947 my $interfaceName = $interface->name; | 2947 my $interfaceName = $interface->name; |
| 2948 my $v8InterfaceName = "V8$interfaceName"; | 2948 my $v8InterfaceName = "V8$interfaceName"; |
| 2949 | 2949 |
| 2950 if (!$namedPropertyGetter) { | 2950 if (!$namedPropertyGetter) { |
| 2951 $namedPropertyGetter = $codeGenerator->FindSuperMethod($interface, "name
dItem"); | 2951 $namedPropertyGetter = $codeGenerator->FindSuperMethod($interface, "name
dItem"); |
| 2952 } | 2952 } |
| 2953 | 2953 |
| 2954 if ($interface->extendedAttributes->{"NamedGetter"}) { | 2954 if ($interface->extendedAttributes->{"NamedGetter"}) { |
| 2955 die "$interfaceName: [NamedGetter] but no namedItem() method." if (!$nam
edPropertyGetter); | 2955 die "$interfaceName: [NamedGetter] but no namedItem() method." if (!$nam
edPropertyGetter); |
| 2956 AddToImplIncludes("V8Collection.h"); | 2956 AddToImplIncludes("bindings/v8/V8Collection.h"); |
| 2957 my $type = $namedPropertyGetter->type; | 2957 my $type = $namedPropertyGetter->type; |
| 2958 $subCode .= <<END; | 2958 $subCode .= <<END; |
| 2959 desc->InstanceTemplate()->SetNamedPropertyHandler(${v8InterfaceName}::namedP
ropertyGetter, 0, 0, 0, 0); | 2959 desc->InstanceTemplate()->SetNamedPropertyHandler(${v8InterfaceName}::namedP
ropertyGetter, 0, 0, 0, 0); |
| 2960 END | 2960 END |
| 2961 | 2961 |
| 2962 my $code .= <<END; | 2962 my $code .= <<END; |
| 2963 v8::Handle<v8::Value> ${v8InterfaceName}::namedPropertyGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | 2963 v8::Handle<v8::Value> ${v8InterfaceName}::namedPropertyGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) |
| 2964 { | 2964 { |
| 2965 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 2965 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 2966 return v8Undefined(); | 2966 return v8Undefined(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3057 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interfac
e); | 3057 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interfac
e); |
| 3058 my $v8InterfaceName = "V8$interfaceName"; | 3058 my $v8InterfaceName = "V8$interfaceName"; |
| 3059 my $nativeType = GetNativeTypeForConversions($interface); | 3059 my $nativeType = GetNativeTypeForConversions($interface); |
| 3060 my $vtableNameGnu = GetGnuVTableNameForInterface($interface); | 3060 my $vtableNameGnu = GetGnuVTableNameForInterface($interface); |
| 3061 my $vtableRefGnu = GetGnuVTableRefForInterface($interface); | 3061 my $vtableRefGnu = GetGnuVTableRefForInterface($interface); |
| 3062 my $vtableRefWin = GetWinVTableRefForInterface($interface); | 3062 my $vtableRefWin = GetWinVTableRefForInterface($interface); |
| 3063 | 3063 |
| 3064 # - Add default header template | 3064 # - Add default header template |
| 3065 push(@implContentHeader, GenerateImplementationContentHeader($interface)); | 3065 push(@implContentHeader, GenerateImplementationContentHeader($interface)); |
| 3066 | 3066 |
| 3067 AddToImplIncludes("BindingState.h"); | 3067 AddToImplIncludes("bindings/v8/BindingState.h"); |
| 3068 AddToImplIncludes("bindings/v8/V8Binding.h"); |
| 3069 AddToImplIncludes("bindings/v8/V8DOMWrapper.h"); |
| 3068 AddToImplIncludes("core/dom/ContextFeatures.h"); | 3070 AddToImplIncludes("core/dom/ContextFeatures.h"); |
| 3069 AddToImplIncludes("V8Binding.h"); | |
| 3070 AddToImplIncludes("V8DOMWrapper.h"); | |
| 3071 AddToImplIncludes("core/page/RuntimeEnabledFeatures.h"); | 3071 AddToImplIncludes("core/page/RuntimeEnabledFeatures.h"); |
| 3072 | 3072 |
| 3073 AddIncludesForType($interfaceName); | 3073 AddIncludesForType($interfaceName); |
| 3074 | 3074 |
| 3075 my $toActiveDOMObject = $codeGenerator->InheritsExtendedAttribute($interface
, "ActiveDOMObject") ? "${v8InterfaceName}::toActiveDOMObject" : "0"; | 3075 my $toActiveDOMObject = $codeGenerator->InheritsExtendedAttribute($interface
, "ActiveDOMObject") ? "${v8InterfaceName}::toActiveDOMObject" : "0"; |
| 3076 my $toEventTarget = $codeGenerator->InheritsExtendedAttribute($interface, "E
ventTarget") ? "${v8InterfaceName}::toEventTarget" : "0"; | 3076 my $toEventTarget = $codeGenerator->InheritsExtendedAttribute($interface, "E
ventTarget") ? "${v8InterfaceName}::toEventTarget" : "0"; |
| 3077 my $rootForGC = NeedsCustomOpaqueRootForGC($interface) ? "${v8InterfaceName}
::opaqueRootForGC" : "0"; | 3077 my $rootForGC = NeedsCustomOpaqueRootForGC($interface) ? "${v8InterfaceName}
::opaqueRootForGC" : "0"; |
| 3078 | 3078 |
| 3079 # Find the super descriptor. | 3079 # Find the super descriptor. |
| 3080 my $parentClass = ""; | 3080 my $parentClass = ""; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3177 $hasConstructors = 1; | 3177 $hasConstructors = 1; |
| 3178 } | 3178 } |
| 3179 next; | 3179 next; |
| 3180 } | 3180 } |
| 3181 | 3181 |
| 3182 if ($attrType eq "EventListener" && $interfaceName eq "DOMWindow") { | 3182 if ($attrType eq "EventListener" && $interfaceName eq "DOMWindow") { |
| 3183 $attrExt->{"OnProto"} = 1; | 3183 $attrExt->{"OnProto"} = 1; |
| 3184 } | 3184 } |
| 3185 | 3185 |
| 3186 if ($attrType eq "SerializedScriptValue") { | 3186 if ($attrType eq "SerializedScriptValue") { |
| 3187 AddToImplIncludes("SerializedScriptValue.h"); | 3187 AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| 3188 } | 3188 } |
| 3189 | 3189 |
| 3190 GenerateNormalAttrGetter($attribute, $interface, ""); | 3190 GenerateNormalAttrGetter($attribute, $interface, ""); |
| 3191 GenerateNormalAttrGetterCallback($attribute, $interface, ""); | 3191 GenerateNormalAttrGetterCallback($attribute, $interface, ""); |
| 3192 if ($attrExt->{"PerWorldBindings"}) { | 3192 if ($attrExt->{"PerWorldBindings"}) { |
| 3193 GenerateNormalAttrGetter($attribute, $interface, "ForMainWorld"); | 3193 GenerateNormalAttrGetter($attribute, $interface, "ForMainWorld"); |
| 3194 GenerateNormalAttrGetterCallback($attribute, $interface, "ForMainWor
ld"); | 3194 GenerateNormalAttrGetterCallback($attribute, $interface, "ForMainWor
ld"); |
| 3195 } | 3195 } |
| 3196 if (!HasCustomSetter($attrExt) && $attrExt->{"Replaceable"}) { | 3196 if (!HasCustomSetter($attrExt) && $attrExt->{"Replaceable"}) { |
| 3197 $hasReplaceable = 1; | 3197 $hasReplaceable = 1; |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3805 my $interface = shift; | 3805 my $interface = shift; |
| 3806 | 3806 |
| 3807 my $interfaceName = $interface->name; | 3807 my $interfaceName = $interface->name; |
| 3808 my $v8InterfaceName = "V8$interfaceName"; | 3808 my $v8InterfaceName = "V8$interfaceName"; |
| 3809 | 3809 |
| 3810 | 3810 |
| 3811 # - Add default header template | 3811 # - Add default header template |
| 3812 AddToHeader(GenerateHeaderContentHeader($interface)); | 3812 AddToHeader(GenerateHeaderContentHeader($interface)); |
| 3813 | 3813 |
| 3814 my @unsortedIncludes = (); | 3814 my @unsortedIncludes = (); |
| 3815 push(@unsortedIncludes, "#include \"ActiveDOMCallback.h\""); | 3815 push(@unsortedIncludes, "#include \"bindings/v8/ActiveDOMCallback.h\""); |
| 3816 push(@unsortedIncludes, "#include \"DOMWrapperWorld.h\""); | 3816 push(@unsortedIncludes, "#include \"bindings/v8/DOMWrapperWorld.h\""); |
| 3817 push(@unsortedIncludes, "#include \"bindings/v8/ScopedPersistent.h\""); |
| 3817 my $interfaceHeader = $codeGenerator->HeaderFileForInterface($interfaceName)
; | 3818 my $interfaceHeader = $codeGenerator->HeaderFileForInterface($interfaceName)
; |
| 3818 push(@unsortedIncludes, "#include \"$interfaceHeader\""); | 3819 push(@unsortedIncludes, "#include \"$interfaceHeader\""); |
| 3819 push(@unsortedIncludes, "#include \"ScopedPersistent.h\""); | |
| 3820 push(@unsortedIncludes, "#include <v8.h>"); | 3820 push(@unsortedIncludes, "#include <v8.h>"); |
| 3821 push(@unsortedIncludes, "#include <wtf/Forward.h>"); | 3821 push(@unsortedIncludes, "#include <wtf/Forward.h>"); |
| 3822 AddToHeader(join("\n", sort @unsortedIncludes)); | 3822 AddToHeader(join("\n", sort @unsortedIncludes)); |
| 3823 | 3823 |
| 3824 AddToHeader("\n\nnamespace WebCore {\n\n"); | 3824 AddToHeader("\n\nnamespace WebCore {\n\n"); |
| 3825 AddToHeader("class ScriptExecutionContext;\n\n"); | 3825 AddToHeader("class ScriptExecutionContext;\n\n"); |
| 3826 AddToHeader("class $v8InterfaceName : public $interfaceName, public ActiveDO
MCallback {\n"); | 3826 AddToHeader("class $v8InterfaceName : public $interfaceName, public ActiveDO
MCallback {\n"); |
| 3827 | 3827 |
| 3828 AddToHeader(<<END); | 3828 AddToHeader(<<END); |
| 3829 public: | 3829 public: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3884 { | 3884 { |
| 3885 my $object = shift; | 3885 my $object = shift; |
| 3886 my $interface = shift; | 3886 my $interface = shift; |
| 3887 my $interfaceName = $interface->name; | 3887 my $interfaceName = $interface->name; |
| 3888 my $v8InterfaceName = "V8$interfaceName"; | 3888 my $v8InterfaceName = "V8$interfaceName"; |
| 3889 | 3889 |
| 3890 # - Add default header template | 3890 # - Add default header template |
| 3891 push(@implContentHeader, GenerateImplementationContentHeader($interface)); | 3891 push(@implContentHeader, GenerateImplementationContentHeader($interface)); |
| 3892 | 3892 |
| 3893 AddToImplIncludes("core/dom/ScriptExecutionContext.h"); | 3893 AddToImplIncludes("core/dom/ScriptExecutionContext.h"); |
| 3894 AddToImplIncludes("V8Binding.h"); | 3894 AddToImplIncludes("bindings/v8/V8Binding.h"); |
| 3895 AddToImplIncludes("V8Callback.h"); | 3895 AddToImplIncludes("bindings/v8/V8Callback.h"); |
| 3896 | 3896 |
| 3897 AddToImplContent("#include <wtf/Assertions.h>\n\n"); | 3897 AddToImplContent("#include <wtf/Assertions.h>\n\n"); |
| 3898 AddToImplContent("namespace WebCore {\n\n"); | 3898 AddToImplContent("namespace WebCore {\n\n"); |
| 3899 | 3899 |
| 3900 AddToImplContent(<<END); | 3900 AddToImplContent(<<END); |
| 3901 ${v8InterfaceName}::${v8InterfaceName}(v8::Handle<v8::Object> callback, ScriptEx
ecutionContext* context) | 3901 ${v8InterfaceName}::${v8InterfaceName}(v8::Handle<v8::Object> callback, ScriptEx
ecutionContext* context) |
| 3902 : ActiveDOMCallback(context) | 3902 : ActiveDOMCallback(context) |
| 3903 , m_callback(callback) | 3903 , m_callback(callback) |
| 3904 , m_world(DOMWrapperWorld::current()) | 3904 , m_world(DOMWrapperWorld::current()) |
| 3905 { | 3905 { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3996 { | 3996 { |
| 3997 my $interface = shift; | 3997 my $interface = shift; |
| 3998 my $v8InterfaceName = shift; | 3998 my $v8InterfaceName = shift; |
| 3999 my $nativeType = shift; | 3999 my $nativeType = shift; |
| 4000 my $interfaceName = $interface->name; | 4000 my $interfaceName = $interface->name; |
| 4001 | 4001 |
| 4002 if ($interface->extendedAttributes->{"NoWrapperCache"} || $interface->extend
edAttributes->{"SuppressToJSObject"}) { | 4002 if ($interface->extendedAttributes->{"NoWrapperCache"} || $interface->extend
edAttributes->{"SuppressToJSObject"}) { |
| 4003 return; | 4003 return; |
| 4004 } | 4004 } |
| 4005 | 4005 |
| 4006 AddToImplIncludes("bindings/v8/ScriptController.h"); |
| 4006 AddToImplIncludes("core/page/Frame.h"); | 4007 AddToImplIncludes("core/page/Frame.h"); |
| 4007 AddToImplIncludes("ScriptController.h"); | |
| 4008 | 4008 |
| 4009 my $createWrapperArgumentType = GetPassRefPtrType($nativeType); | 4009 my $createWrapperArgumentType = GetPassRefPtrType($nativeType); |
| 4010 my $baseType = BaseInterfaceName($interface); | 4010 my $baseType = BaseInterfaceName($interface); |
| 4011 | 4011 |
| 4012 my $code = ""; | 4012 my $code = ""; |
| 4013 $code .= <<END; | 4013 $code .= <<END; |
| 4014 | 4014 |
| 4015 v8::Handle<v8::Object> ${v8InterfaceName}::createWrapper(${createWrapperArgument
Type} impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 4015 v8::Handle<v8::Object> ${v8InterfaceName}::createWrapper(${createWrapperArgument
Type} impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 4016 { | 4016 { |
| 4017 ASSERT(impl.get()); | 4017 ASSERT(impl.get()); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4469 | 4469 |
| 4470 if ($type eq "DOMString") { | 4470 if ($type eq "DOMString") { |
| 4471 return $value; | 4471 return $value; |
| 4472 } | 4472 } |
| 4473 | 4473 |
| 4474 if ($codeGenerator->IsEnumType($type)) { | 4474 if ($codeGenerator->IsEnumType($type)) { |
| 4475 return $value; | 4475 return $value; |
| 4476 } | 4476 } |
| 4477 | 4477 |
| 4478 if ($type eq "SerializedScriptValue") { | 4478 if ($type eq "SerializedScriptValue") { |
| 4479 AddToImplIncludes("SerializedScriptValue.h"); | 4479 AddToImplIncludes("bindings/v8/SerializedScriptValue.h"); |
| 4480 return "SerializedScriptValue::create($value, $getIsolate)"; | 4480 return "SerializedScriptValue::create($value, $getIsolate)"; |
| 4481 } | 4481 } |
| 4482 | 4482 |
| 4483 if ($type eq "Dictionary") { | 4483 if ($type eq "Dictionary") { |
| 4484 AddToImplIncludes("Dictionary.h"); | 4484 AddToImplIncludes("bindings/v8/Dictionary.h"); |
| 4485 return "Dictionary($value, $getIsolate)"; | 4485 return "Dictionary($value, $getIsolate)"; |
| 4486 } | 4486 } |
| 4487 | 4487 |
| 4488 if ($type eq "any") { | 4488 if ($type eq "any") { |
| 4489 AddToImplIncludes("ScriptValue.h"); | 4489 AddToImplIncludes("bindings/v8/ScriptValue.h"); |
| 4490 return "ScriptValue($value)"; | 4490 return "ScriptValue($value)"; |
| 4491 } | 4491 } |
| 4492 | 4492 |
| 4493 if ($type eq "NodeFilter") { | 4493 if ($type eq "NodeFilter") { |
| 4494 return "toNodeFilter($value)"; | 4494 return "toNodeFilter($value)"; |
| 4495 } | 4495 } |
| 4496 | 4496 |
| 4497 if ($type eq "MediaQueryListListener") { | 4497 if ($type eq "MediaQueryListListener") { |
| 4498 AddToImplIncludes("core/css/MediaQueryListListener.h"); | 4498 AddToImplIncludes("core/css/MediaQueryListListener.h"); |
| 4499 return "MediaQueryListListener::create(" . $value . ")"; | 4499 return "MediaQueryListListener::create(" . $value . ")"; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 4523 | 4523 |
| 4524 AddToImplIncludes("V8${type}.h"); | 4524 AddToImplIncludes("V8${type}.h"); |
| 4525 return "V8${type}::HasInstance($value, $getIsolate, worldType($getIsolate))
? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0"; | 4525 return "V8${type}::HasInstance($value, $getIsolate, worldType($getIsolate))
? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0"; |
| 4526 } | 4526 } |
| 4527 | 4527 |
| 4528 sub GetV8HeaderName | 4528 sub GetV8HeaderName |
| 4529 { | 4529 { |
| 4530 my $type = shift; | 4530 my $type = shift; |
| 4531 return "V8Event.h" if $type eq "DOMTimeStamp"; | 4531 return "V8Event.h" if $type eq "DOMTimeStamp"; |
| 4532 return "core/dom/EventListener.h" if $type eq "EventListener"; | 4532 return "core/dom/EventListener.h" if $type eq "EventListener"; |
| 4533 return "SerializedScriptValue.h" if $type eq "SerializedScriptValue"; | 4533 return "bindings/v8/SerializedScriptValue.h" if $type eq "SerializedScriptVa
lue"; |
| 4534 return "ScriptValue.h" if $type eq "any"; | 4534 return "bindings/v8/ScriptValue.h" if $type eq "any"; |
| 4535 return "V8${type}.h"; | 4535 return "V8${type}.h"; |
| 4536 } | 4536 } |
| 4537 | 4537 |
| 4538 sub CreateCustomSignature | 4538 sub CreateCustomSignature |
| 4539 { | 4539 { |
| 4540 my $function = shift; | 4540 my $function = shift; |
| 4541 my $count = @{$function->parameters}; | 4541 my $count = @{$function->parameters}; |
| 4542 my $name = $function->signature->name; | 4542 my $name = $function->signature->name; |
| 4543 my $code = " const int ${name}Argc = ${count};\n" . | 4543 my $code = " const int ${name}Argc = ${count};\n" . |
| 4544 " v8::Handle<v8::FunctionTemplate> ${name}Argv[${name}Argc] = { "; | 4544 " v8::Handle<v8::FunctionTemplate> ${name}Argv[${name}Argc] = { "; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4775 AddIncludesForType($type); | 4775 AddIncludesForType($type); |
| 4776 | 4776 |
| 4777 if (IsDOMNodeType($type) || $type eq "EventTarget") { | 4777 if (IsDOMNodeType($type) || $type eq "EventTarget") { |
| 4778 if ($getScriptWrappable) { | 4778 if ($getScriptWrappable) { |
| 4779 return "toV8Fast${forMainWorldSuffix}($value$getHolderContainerArg$get
ScriptWrappableArg)"; | 4779 return "toV8Fast${forMainWorldSuffix}($value$getHolderContainerArg$get
ScriptWrappableArg)"; |
| 4780 } | 4780 } |
| 4781 return "toV8($value, $getCreationContext, $getIsolate)"; | 4781 return "toV8($value, $getCreationContext, $getIsolate)"; |
| 4782 } | 4782 } |
| 4783 | 4783 |
| 4784 if ($type eq "EventListener") { | 4784 if ($type eq "EventListener") { |
| 4785 AddToImplIncludes("V8AbstractEventListener.h"); | 4785 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| 4786 return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventList
ener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle
<v8::Value>(v8Null($getIsolate))"; | 4786 return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventList
ener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle
<v8::Value>(v8Null($getIsolate))"; |
| 4787 } | 4787 } |
| 4788 | 4788 |
| 4789 if ($type eq "SerializedScriptValue") { | 4789 if ($type eq "SerializedScriptValue") { |
| 4790 AddToImplIncludes("$type.h"); | 4790 AddToImplIncludes("$type.h"); |
| 4791 return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8Null($g
etIsolate))"; | 4791 return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8Null($g
etIsolate))"; |
| 4792 } | 4792 } |
| 4793 | 4793 |
| 4794 AddToImplIncludes("wtf/RefCounted.h"); | 4794 AddToImplIncludes("wtf/RefCounted.h"); |
| 4795 AddToImplIncludes("wtf/RefPtr.h"); | 4795 AddToImplIncludes("wtf/RefPtr.h"); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4907 | 4907 |
| 4908 sub GetPassRefPtrType | 4908 sub GetPassRefPtrType |
| 4909 { | 4909 { |
| 4910 my $v8InterfaceName = shift; | 4910 my $v8InterfaceName = shift; |
| 4911 | 4911 |
| 4912 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; | 4912 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; |
| 4913 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; | 4913 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; |
| 4914 } | 4914 } |
| 4915 | 4915 |
| 4916 1; | 4916 1; |
| OLD | NEW |