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"}; | 822 my $setHiddenValue = $interface->extendedAttributes->{"SetHiddenValueTo"}; |
823 my $customWrap = $interface->extendedAttributes->{"CustomToV8"} || $setHidde nValue; | |
823 if ($noToV8) { | 824 if ($noToV8) { |
824 die "Can't suppress toV8 for subclass\n" if $interface->parent; | 825 die "Can't suppress toV8 for subclass\n" if $interface->parent; |
825 } elsif ($noWrap) { | 826 } elsif ($noWrap) { |
826 die "Must have custom toV8\n" if !$customWrap; | 827 die "Must have custom toV8\n" if !$customWrap; |
827 $header{nameSpaceWebCore}->add(<<END); | 828 $header{nameSpaceWebCore}->add(<<END); |
828 class ${nativeType}; | 829 class ${nativeType}; |
829 v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContex t, v8::Isolate*); | 830 v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContex t, v8::Isolate*); |
830 | 831 |
831 template<class CallbackInfo> | 832 template<class CallbackInfo> |
832 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ${nativeType}* im pl, v8::Handle<v8::Object> creationContext) | 833 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ${nativeType}* im pl, v8::Handle<v8::Object> creationContext) |
(...skipping 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3995 ASSERT(impl); | 3996 ASSERT(impl); |
3996 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate); | 3997 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate); |
3997 if (!wrapper.IsEmpty()) | 3998 if (!wrapper.IsEmpty()) |
3998 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $a rrayType, impl->length()); | 3999 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $a rrayType, impl->length()); |
3999 return wrapper; | 4000 return wrapper; |
4000 } | 4001 } |
4001 | 4002 |
4002 END | 4003 END |
4003 } | 4004 } |
4004 | 4005 |
4006 my $setHiddenValue = $interface->extendedAttributes->{"SetHiddenValueTo"}; | |
4007 if ($setHiddenValue) { | |
4008 my @hiddenValues = split /\s*\|\s*/, $setHiddenValue; | |
4009 | |
kouhei (in TOK)
2013/09/10 01:30:34
I think we need to addIncludesForType(<$setHiddenV
Nils Barth (inactive)
2013/09/10 01:50:55
Discussed offline; issue is that required include
| |
4010 $implementation{nameSpaceWebCore}->add(<<END); | |
4011 v8::Handle<v8::Object> wrap($implClassName* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) | |
4012 { | |
4013 ASSERT(impl); | |
4014 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate); | |
4015 END | |
4016 foreach my $hiddenValue (@hiddenValues) { | |
4017 $implementation{nameSpaceWebCore}->add(<<END); | |
4018 if (impl->$hiddenValue()) | |
4019 V8HiddenPropertyName::setNamedHiddenReference(wrapper, "$hiddenValue", t oV8(impl->$hiddenValue(), creationContext, isolate)); | |
4020 END | |
4021 } | |
4022 | |
4023 $implementation{nameSpaceWebCore}->add(<<END); | |
4024 return wrapper; | |
4025 } | |
4026 | |
4027 END | |
4028 } | |
4029 | |
4005 my @enabledPerContextFunctions; | 4030 my @enabledPerContextFunctions; |
4006 my @normalFunctions; | 4031 my @normalFunctions; |
4007 my $needsDomainSafeFunctionSetter = 0; | 4032 my $needsDomainSafeFunctionSetter = 0; |
4008 # Generate methods for functions. | 4033 # Generate methods for functions. |
4009 foreach my $function (@{$interface->functions}) { | 4034 foreach my $function (@{$interface->functions}) { |
4010 next if $function->name eq ""; | 4035 next if $function->name eq ""; |
4011 GenerateFunction($function, $interface, ""); | 4036 GenerateFunction($function, $interface, ""); |
4012 if ($function->extendedAttributes->{"PerWorldBindings"}) { | 4037 if ($function->extendedAttributes->{"PerWorldBindings"}) { |
4013 GenerateFunction($function, $interface, "ForMainWorld"); | 4038 GenerateFunction($function, $interface, "ForMainWorld"); |
4014 } | 4039 } |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6015 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6040 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
6016 $found = 1; | 6041 $found = 1; |
6017 } | 6042 } |
6018 return 1 if $found; | 6043 return 1 if $found; |
6019 }, 0); | 6044 }, 0); |
6020 | 6045 |
6021 return $found; | 6046 return $found; |
6022 } | 6047 } |
6023 | 6048 |
6024 1; | 6049 1; |
OLD | NEW |