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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 return value; | 1148 return value; |
1149 END | 1149 END |
1150 } else { | 1150 } else { |
1151 push(@implContentDecls, " return " . NativeToJSValue($attribute->sign
ature, $result, "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsa
feHandle").";\n"); | 1151 push(@implContentDecls, " return " . NativeToJSValue($attribute->sign
ature, $result, "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsa
feHandle").";\n"); |
1152 } | 1152 } |
1153 | 1153 |
1154 push(@implContentDecls, "}\n\n"); # end of getter | 1154 push(@implContentDecls, "}\n\n"); # end of getter |
1155 push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditiona
lString; | 1155 push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditiona
lString; |
1156 } | 1156 } |
1157 | 1157 |
1158 sub GenerateReplaceableAttrSetterCallback | |
1159 { | |
1160 my $interface = shift; | |
1161 my $interfaceName = $interface->name; | |
1162 | |
1163 push(@implContentDecls, "static void ${interfaceName}ReplaceableAttrSetterCa
llback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Accesso
rInfo& info)\n"); | |
1164 push(@implContentDecls, "{\n"); | |
1165 push(@implContentDecls, GenerateFeatureObservation($interface->extendedAttri
butes->{"V8MeasureAs"})); | |
1166 push(@implContentDecls, " return ${interfaceName}V8Internal::${interfaceN
ame}ReplaceableAttrSetter(name, value, info);\n"); | |
1167 push(@implContentDecls, "}\n\n"); | |
1168 } | |
1169 | |
1170 sub GenerateReplaceableAttrSetter | 1158 sub GenerateReplaceableAttrSetter |
1171 { | 1159 { |
1172 my $interface = shift; | 1160 my $interface = shift; |
1173 my $interfaceName = $interface->name; | 1161 my $interfaceName = $interface->name; |
1174 | 1162 |
1175 push(@implContentDecls, <<END); | 1163 push(@implContentDecls, <<END); |
1176 static void ${interfaceName}ReplaceableAttrSetter(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | 1164 static void ${interfaceName}ReplaceableAttrSetter(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) |
1177 { | 1165 { |
1178 END | 1166 END |
| 1167 push(@implContentDecls, GenerateFeatureObservation($interface->extendedAttri
butes->{"V8MeasureAs"})); |
| 1168 |
1179 if ($interface->extendedAttributes->{"CheckSecurity"}) { | 1169 if ($interface->extendedAttributes->{"CheckSecurity"}) { |
1180 AddToImplIncludes("Frame.h"); | 1170 AddToImplIncludes("Frame.h"); |
1181 push(@implContentDecls, <<END); | 1171 push(@implContentDecls, <<END); |
1182 ${interfaceName}* imp = V8${interfaceName}::toNative(info.Holder()); | 1172 ${interfaceName}* imp = V8${interfaceName}::toNative(info.Holder()); |
1183 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp
->frame())) | 1173 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp
->frame())) |
1184 return; | 1174 return; |
1185 END | 1175 END |
1186 } | 1176 } |
1187 | 1177 |
1188 push(@implContentDecls, <<END); | 1178 push(@implContentDecls, <<END); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 my $constructorType = $attribute->signature->type; | 2332 my $constructorType = $attribute->signature->type; |
2343 $constructorType =~ s/Constructor$//; | 2333 $constructorType =~ s/Constructor$//; |
2344 # $constructorType ~= /Constructor$/ indicates that it is NamedConstruct
or. | 2334 # $constructorType ~= /Constructor$/ indicates that it is NamedConstruct
or. |
2345 # We do not generate the header file for NamedConstructor of class XXXX, | 2335 # We do not generate the header file for NamedConstructor of class XXXX, |
2346 # since we generate the NamedConstructor declaration into the header fil
e of class XXXX. | 2336 # since we generate the NamedConstructor declaration into the header fil
e of class XXXX. |
2347 if ($constructorType !~ /Constructor$/ || $attribute->signature->extende
dAttributes->{"V8CustomConstructor"} || $attribute->signature->extendedAttribute
s->{"CustomConstructor"}) { | 2337 if ($constructorType !~ /Constructor$/ || $attribute->signature->extende
dAttributes->{"V8CustomConstructor"} || $attribute->signature->extendedAttribute
s->{"CustomConstructor"}) { |
2348 AddToImplIncludes("V8${constructorType}.h", $attribute->signature->e
xtendedAttributes->{"Conditional"}); | 2338 AddToImplIncludes("V8${constructorType}.h", $attribute->signature->e
xtendedAttributes->{"Conditional"}); |
2349 } | 2339 } |
2350 $data = "&V8${constructorType}::info"; | 2340 $data = "&V8${constructorType}::info"; |
2351 $getter = "${interfaceName}V8Internal::${interfaceName}ConstructorGetter
"; | 2341 $getter = "${interfaceName}V8Internal::${interfaceName}ConstructorGetter
"; |
2352 $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAttrSe
tterCallback"; | 2342 $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAttrSe
tter"; |
2353 } else { | 2343 } else { |
2354 # Default Getter and Setter | 2344 # Default Getter and Setter |
2355 $getter = "${interfaceName}V8Internal::${attrName}AttrGetterCallback"; | 2345 $getter = "${interfaceName}V8Internal::${attrName}AttrGetterCallback"; |
2356 $setter = "${interfaceName}V8Internal::${attrName}AttrSetterCallback"; | 2346 $setter = "${interfaceName}V8Internal::${attrName}AttrSetterCallback"; |
2357 | 2347 |
2358 if (!HasCustomSetter($attrExt) && $attrExt->{"Replaceable"}) { | 2348 if (!HasCustomSetter($attrExt) && $attrExt->{"Replaceable"}) { |
2359 $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAt
trSetterCallback"; | 2349 $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAt
trSetter"; |
2360 } | 2350 } |
2361 } | 2351 } |
2362 | 2352 |
2363 # Read only attributes | 2353 # Read only attributes |
2364 if (IsReadonly($attribute)) { | 2354 if (IsReadonly($attribute)) { |
2365 $setter = "0"; | 2355 $setter = "0"; |
2366 } | 2356 } |
2367 | 2357 |
2368 # An accessor can be installed on the proto | 2358 # An accessor can be installed on the proto |
2369 if ($attrExt->{"V8OnProto"}) { | 2359 if ($attrExt->{"V8OnProto"}) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 GenerateNormalAttrSetterCallback($attribute, $interface); | 2758 GenerateNormalAttrSetterCallback($attribute, $interface); |
2769 } | 2759 } |
2770 } | 2760 } |
2771 | 2761 |
2772 if ($hasConstructors) { | 2762 if ($hasConstructors) { |
2773 GenerateConstructorGetter($interface); | 2763 GenerateConstructorGetter($interface); |
2774 } | 2764 } |
2775 | 2765 |
2776 if ($hasConstructors || $hasReplaceable) { | 2766 if ($hasConstructors || $hasReplaceable) { |
2777 GenerateReplaceableAttrSetter($interface); | 2767 GenerateReplaceableAttrSetter($interface); |
2778 GenerateReplaceableAttrSetterCallback($interface); | |
2779 } | 2768 } |
2780 | 2769 |
2781 if (NeedsCustomOpaqueRootForGC($interface)) { | 2770 if (NeedsCustomOpaqueRootForGC($interface)) { |
2782 GenerateOpaqueRootForGC($interface); | 2771 GenerateOpaqueRootForGC($interface); |
2783 } | 2772 } |
2784 | 2773 |
2785 if ($interface->extendedAttributes->{"TypedArray"}) { | 2774 if ($interface->extendedAttributes->{"TypedArray"}) { |
2786 my $viewType = GetTypeNameOfExternalTypedArray($interface); | 2775 my $viewType = GetTypeNameOfExternalTypedArray($interface); |
2787 push(@implContent, <<END); | 2776 push(@implContent, <<END); |
2788 v8::Handle<v8::Object> wrap($interfaceName* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 2777 v8::Handle<v8::Object> wrap($interfaceName* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4413 | 4402 |
4414 sub GetPassRefPtrType | 4403 sub GetPassRefPtrType |
4415 { | 4404 { |
4416 my $v8InterfaceName = shift; | 4405 my $v8InterfaceName = shift; |
4417 | 4406 |
4418 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; | 4407 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; |
4419 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; | 4408 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; |
4420 } | 4409 } |
4421 | 4410 |
4422 1; | 4411 1; |
OLD | NEW |