| 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 2915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2926 last if $index eq $paramIndex; | 2926 last if $index eq $paramIndex; |
| 2927 if ($replacements{$parameter->name}) { | 2927 if ($replacements{$parameter->name}) { |
| 2928 push(@argumentList, $replacements{$parameter->name}); | 2928 push(@argumentList, $replacements{$parameter->name}); |
| 2929 } else { | 2929 } else { |
| 2930 push(@argumentList, $parameter->name); | 2930 push(@argumentList, $parameter->name); |
| 2931 } | 2931 } |
| 2932 $index++; | 2932 $index++; |
| 2933 } | 2933 } |
| 2934 | 2934 |
| 2935 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr
gumentList); | 2935 my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterAr
gumentList); |
| 2936 my $refPtrType = IsGarbageCollectedType($interfaceName) ? "RefPtrWillBeRawPt
r<$implClassName>" : "RefPtr<$implClassName>"; | 2936 $code .= " RefPtr<${implClassName}> impl = ${implClassName}::create(${arg
umentString});\n"; |
| 2937 $code .= " $refPtrType impl = ${implClassName}::create(${argumentString})
;\n"; | |
| 2938 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n"; | 2937 $code .= " v8::Handle<v8::Object> wrapper = info.Holder();\n"; |
| 2939 | 2938 |
| 2940 if ($constructorRaisesException) { | 2939 if ($constructorRaisesException) { |
| 2941 $code .= " if (exceptionState.throwIfNeeded())\n"; | 2940 $code .= " if (exceptionState.throwIfNeeded())\n"; |
| 2942 $code .= " return;\n"; | 2941 $code .= " return;\n"; |
| 2943 } | 2942 } |
| 2944 | 2943 |
| 2945 $code .= <<END; | 2944 $code .= <<END; |
| 2946 | 2945 |
| 2947 V8DOMWrapper::associateObjectWithWrapper<${v8ClassName}>(impl.release(), &${
v8ClassName}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration:
:Dependent); | 2946 V8DOMWrapper::associateObjectWithWrapper<${v8ClassName}>(impl.release(), &${
v8ClassName}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration:
:Dependent); |
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5154 sub GenerateToV8Converters | 5153 sub GenerateToV8Converters |
| 5155 { | 5154 { |
| 5156 my $interface = shift; | 5155 my $interface = shift; |
| 5157 my $v8ClassName = shift; | 5156 my $v8ClassName = shift; |
| 5158 my $interfaceName = $interface->name; | 5157 my $interfaceName = $interface->name; |
| 5159 | 5158 |
| 5160 if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "T
oV8")) { | 5159 if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "T
oV8")) { |
| 5161 return; | 5160 return; |
| 5162 } | 5161 } |
| 5163 | 5162 |
| 5164 my $passRefPtrType = GetPassRefPtrType($interface); | 5163 my $createWrapperArgumentType = GetPassRefPtrType($interface); |
| 5165 | 5164 |
| 5166 # FIXME: Do we really need to treat /SVG/ as dependent DOM objects? | 5165 # FIXME: Do we really need to treat /SVG/ as dependent DOM objects? |
| 5167 my $wrapperConfiguration = "WrapperConfiguration::Independent"; | 5166 my $wrapperConfiguration = "WrapperConfiguration::Independent"; |
| 5168 if (InheritsExtendedAttribute($interface, "ActiveDOMObject") | 5167 if (InheritsExtendedAttribute($interface, "ActiveDOMObject") |
| 5169 || InheritsExtendedAttribute($interface, "DependentLifetime") | 5168 || InheritsExtendedAttribute($interface, "DependentLifetime") |
| 5170 || NeedsVisitDOMWrapper($interface) | 5169 || NeedsVisitDOMWrapper($interface) |
| 5171 || $v8ClassName =~ /SVG/) { | 5170 || $v8ClassName =~ /SVG/) { |
| 5172 $wrapperConfiguration = "WrapperConfiguration::Dependent"; | 5171 $wrapperConfiguration = "WrapperConfiguration::Dependent"; |
| 5173 } | 5172 } |
| 5174 | 5173 |
| 5175 my $code = ""; | 5174 my $code = ""; |
| 5176 $code .= <<END; | 5175 $code .= <<END; |
| 5177 v8::Handle<v8::Object> ${v8ClassName}::createWrapper(${passRefPtrType} impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | 5176 v8::Handle<v8::Object> ${v8ClassName}::createWrapper(${createWrapperArgumentType
} impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 5178 { | 5177 { |
| 5179 ASSERT(impl); | 5178 ASSERT(impl); |
| 5180 ASSERT(!DOMDataStore::containsWrapper<${v8ClassName}>(impl.get(), isolate)); | 5179 ASSERT(!DOMDataStore::containsWrapper<${v8ClassName}>(impl.get(), isolate)); |
| 5181 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 5180 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 5182 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 5181 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 5183 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 5182 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 5184 // the same object de-ref functions, though, so use that as the basis of
the check. | 5183 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 5185 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 5184 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 5186 } | 5185 } |
| 5187 | 5186 |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6470 if ($parameter->type eq "SerializedScriptValue") { | 6469 if ($parameter->type eq "SerializedScriptValue") { |
| 6471 return 1; | 6470 return 1; |
| 6472 } elsif (IsIntegerType($parameter->type)) { | 6471 } elsif (IsIntegerType($parameter->type)) { |
| 6473 return 1; | 6472 return 1; |
| 6474 } | 6473 } |
| 6475 } | 6474 } |
| 6476 return 0; | 6475 return 0; |
| 6477 } | 6476 } |
| 6478 | 6477 |
| 6479 1; | 6478 1; |
| OLD | NEW |