| 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 | 812 |
| 813 $header{nameSpaceWebCore}->add(<<END); | 813 $header{nameSpaceWebCore}->add(<<END); |
| 814 | 814 |
| 815 template<> | 815 template<> |
| 816 class WrapperTypeTraits<${nativeType} > { | 816 class WrapperTypeTraits<${nativeType} > { |
| 817 public: | 817 public: |
| 818 static WrapperTypeInfo* info() { return &${v8ClassName}::info; } | 818 static WrapperTypeInfo* info() { return &${v8ClassName}::info; } |
| 819 }; | 819 }; |
| 820 END | 820 END |
| 821 | 821 |
| 822 my $customWrap = $interface->extendedAttributes->{"CustomToV8"} || SVGTypeNe
edsToHoldContextElement($interface->name); | 822 my $customWrap = $interface->extendedAttributes->{"CustomToV8"}; |
| 823 if ($noToV8) { | 823 if ($noToV8) { |
| 824 die "Can't suppress toV8 for subclass\n" if $interface->parent; | 824 die "Can't suppress toV8 for subclass\n" if $interface->parent; |
| 825 } elsif ($noWrap) { | 825 } elsif ($noWrap) { |
| 826 die "Must have custom toV8\n" if !$customWrap; | 826 die "Must have custom toV8\n" if !$customWrap; |
| 827 $header{nameSpaceWebCore}->add(<<END); | 827 $header{nameSpaceWebCore}->add(<<END); |
| 828 class ${nativeType}; | 828 class ${nativeType}; |
| 829 v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContex
t, v8::Isolate*); | 829 v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContex
t, v8::Isolate*); |
| 830 | 830 |
| 831 template<class CallbackInfo> | 831 template<class CallbackInfo> |
| 832 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ${nativeType}* im
pl, v8::Handle<v8::Object> creationContext) | 832 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ${nativeType}* im
pl, v8::Handle<v8::Object> creationContext) |
| (...skipping 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4055 ASSERT(impl); | 4055 ASSERT(impl); |
| 4056 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio
nContext, isolate); | 4056 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio
nContext, isolate); |
| 4057 if (!wrapper.IsEmpty()) | 4057 if (!wrapper.IsEmpty()) |
| 4058 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $a
rrayType, impl->length()); | 4058 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $a
rrayType, impl->length()); |
| 4059 return wrapper; | 4059 return wrapper; |
| 4060 } | 4060 } |
| 4061 | 4061 |
| 4062 END | 4062 END |
| 4063 } | 4063 } |
| 4064 | 4064 |
| 4065 # Add strong reference from TearOff to SVGElement, so that SVGElement would
never get GC-ed while the TearOff is alive. We do this in V8-side to avoid circu
lar reference on Blink side. | |
| 4066 if (SVGTypeNeedsToHoldContextElement($interface->name)) { | |
| 4067 # below include needed for SVGPathSegListPropertyTearOff | |
| 4068 AddToImplIncludes("V8SVGPathElement.h"); | |
| 4069 $implementation{nameSpaceWebCore}->add(<<END); | |
| 4070 v8::Handle<v8::Object> wrap($nativeType* impl, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate* isolate) | |
| 4071 { | |
| 4072 ASSERT(impl); | |
| 4073 ASSERT(!DOMDataStore::containsWrapper<${v8ClassName}>(impl, isolate)); | |
| 4074 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio
nContext, isolate); | |
| 4075 if (impl->contextElement()) | |
| 4076 V8HiddenPropertyName::setNamedHiddenReference(wrapper, "contextElement",
toV8(impl->contextElement(), creationContext, isolate)); | |
| 4077 return wrapper; | |
| 4078 } | |
| 4079 | |
| 4080 END | |
| 4081 } | |
| 4082 | |
| 4083 my @enabledPerContextFunctions; | 4065 my @enabledPerContextFunctions; |
| 4084 my @normalFunctions; | 4066 my @normalFunctions; |
| 4085 my $needsDomainSafeFunctionSetter = 0; | 4067 my $needsDomainSafeFunctionSetter = 0; |
| 4086 # Generate methods for functions. | 4068 # Generate methods for functions. |
| 4087 foreach my $function (@{$interface->functions}) { | 4069 foreach my $function (@{$interface->functions}) { |
| 4088 next if $function->name eq ""; | 4070 next if $function->name eq ""; |
| 4089 GenerateFunction($function, $interface, ""); | 4071 GenerateFunction($function, $interface, ""); |
| 4090 if ($function->extendedAttributes->{"PerWorldBindings"}) { | 4072 if ($function->extendedAttributes->{"PerWorldBindings"}) { |
| 4091 GenerateFunction($function, $interface, "ForMainWorld"); | 4073 GenerateFunction($function, $interface, "ForMainWorld"); |
| 4092 } | 4074 } |
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5837 return $svgTypeNeedingTearOff; | 5819 return $svgTypeNeedingTearOff; |
| 5838 } | 5820 } |
| 5839 | 5821 |
| 5840 sub IsSVGAnimatedType | 5822 sub IsSVGAnimatedType |
| 5841 { | 5823 { |
| 5842 my $type = shift; | 5824 my $type = shift; |
| 5843 | 5825 |
| 5844 return $type =~ /^SVGAnimated/; | 5826 return $type =~ /^SVGAnimated/; |
| 5845 } | 5827 } |
| 5846 | 5828 |
| 5847 sub SVGTypeNeedsToHoldContextElement | |
| 5848 { | |
| 5849 my $type = shift; | |
| 5850 | |
| 5851 return IsSVGTypeNeedingTearOff($type) || IsSVGAnimatedType($type); | |
| 5852 } | |
| 5853 | |
| 5854 sub GetSequenceType | 5829 sub GetSequenceType |
| 5855 { | 5830 { |
| 5856 my $type = shift; | 5831 my $type = shift; |
| 5857 | 5832 |
| 5858 return $1 if $type =~ /^sequence<([\w\d_\s]+)>.*/; | 5833 return $1 if $type =~ /^sequence<([\w\d_\s]+)>.*/; |
| 5859 return ""; | 5834 return ""; |
| 5860 } | 5835 } |
| 5861 | 5836 |
| 5862 sub GetArrayType | 5837 sub GetArrayType |
| 5863 { | 5838 { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6117 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6092 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
| 6118 $found = 1; | 6093 $found = 1; |
| 6119 } | 6094 } |
| 6120 return 1 if $found; | 6095 return 1 if $found; |
| 6121 }, 0); | 6096 }, 0); |
| 6122 | 6097 |
| 6123 return $found; | 6098 return $found; |
| 6124 } | 6099 } |
| 6125 | 6100 |
| 6126 1; | 6101 1; |
| OLD | NEW |