| 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 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3255 my $attrExt = $attribute->extendedAttributes; | 3255 my $attrExt = $attribute->extendedAttributes; |
| 3256 my $code = ""; | 3256 my $code = ""; |
| 3257 | 3257 |
| 3258 my ($attrName, $getter, $setter, $getterForMainWorld, $setterForMainWorld, $
data, $accessControl, $propAttribute, $onProto) = GenerateAttributeConfiguration
Parameters($interface, $attribute); | 3258 my ($attrName, $getter, $setter, $getterForMainWorld, $setterForMainWorld, $
data, $accessControl, $propAttribute, $onProto) = GenerateAttributeConfiguration
Parameters($interface, $attribute); |
| 3259 | 3259 |
| 3260 die "Static attributes do not support optimized getters or setters for the m
ain world" if $getterForMainWorld || $setterForMainWorld; | 3260 die "Static attributes do not support optimized getters or setters for the m
ain world" if $getterForMainWorld || $setterForMainWorld; |
| 3261 | 3261 |
| 3262 my $conditionalString = GenerateConditionalString($attribute); | 3262 my $conditionalString = GenerateConditionalString($attribute); |
| 3263 | 3263 |
| 3264 $code .= "#if ${conditionalString}\n" if $conditionalString; | 3264 $code .= "#if ${conditionalString}\n" if $conditionalString; |
| 3265 $code .= " functionTemplate->SetNativeDataProperty(v8::String::NewSymbol(
\"$attrName\"), $getter, $setter, v8::External::New($data), $propAttribute, v8::
Handle<v8::AccessorSignature>(), $accessControl);\n"; | 3265 $code .= " functionTemplate->SetNativeDataProperty(v8::String::NewSymbol(
\"$attrName\"), $getter, $setter, v8::External::New(isolate, $data), $propAttrib
ute, v8::Handle<v8::AccessorSignature>(), $accessControl);\n"; |
| 3266 $code .= "#endif // ${conditionalString}\n" if $conditionalString; | 3266 $code .= "#endif // ${conditionalString}\n" if $conditionalString; |
| 3267 | 3267 |
| 3268 return $code; | 3268 return $code; |
| 3269 } | 3269 } |
| 3270 | 3270 |
| 3271 sub IsStandardFunction | 3271 sub IsStandardFunction |
| 3272 { | 3272 { |
| 3273 my $interface = shift; | 3273 my $interface = shift; |
| 3274 my $function = shift; | 3274 my $function = shift; |
| 3275 | 3275 |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4394 } elsif (IsConstructorTemplate($interface, "Event")) { | 4394 } elsif (IsConstructorTemplate($interface, "Event")) { |
| 4395 GenerateEventConstructor($interface); | 4395 GenerateEventConstructor($interface); |
| 4396 } | 4396 } |
| 4397 } | 4397 } |
| 4398 if (IsConstructable($interface)) { | 4398 if (IsConstructable($interface)) { |
| 4399 GenerateConstructorCallback($interface); | 4399 GenerateConstructorCallback($interface); |
| 4400 } | 4400 } |
| 4401 | 4401 |
| 4402 my $accessCheck = ""; | 4402 my $accessCheck = ""; |
| 4403 if ($interface->extendedAttributes->{"CheckSecurity"} && $interfaceName ne "
Window") { | 4403 if ($interface->extendedAttributes->{"CheckSecurity"} && $interfaceName ne "
Window") { |
| 4404 $accessCheck = "instanceTemplate->SetAccessCheckCallbacks(${implClassNam
e}V8Internal::namedSecurityCheck, ${implClassName}V8Internal::indexedSecurityChe
ck, v8::External::New(const_cast<WrapperTypeInfo*>(&${v8ClassName}::wrapperTypeI
nfo)));"; | 4404 $accessCheck = "instanceTemplate->SetAccessCheckCallbacks(${implClassNam
e}V8Internal::namedSecurityCheck, ${implClassName}V8Internal::indexedSecurityChe
ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&${v8ClassName}::wra
pperTypeInfo)));"; |
| 4405 } | 4405 } |
| 4406 | 4406 |
| 4407 # For the Window interface, generate the shadow object template | 4407 # For the Window interface, generate the shadow object template |
| 4408 # configuration method. | 4408 # configuration method. |
| 4409 if ($interfaceName eq "Window") { | 4409 if ($interfaceName eq "Window") { |
| 4410 $implementation{nameSpaceWebCore}->add(<<END); | 4410 $implementation{nameSpaceWebCore}->add(<<END); |
| 4411 static void ConfigureShadowObjectTemplate(v8::Handle<v8::ObjectTemplate> templ,
v8::Isolate* isolate, WrapperWorldType currentWorldType) | 4411 static void ConfigureShadowObjectTemplate(v8::Handle<v8::ObjectTemplate> templ,
v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| 4412 { | 4412 { |
| 4413 V8DOMConfiguration::installAttributes(templ, v8::Handle<v8::ObjectTemplate>(
), shadowAttributes, WTF_ARRAY_LENGTH(shadowAttributes), isolate, currentWorldTy
pe); | 4413 V8DOMConfiguration::installAttributes(templ, v8::Handle<v8::ObjectTemplate>(
), shadowAttributes, WTF_ARRAY_LENGTH(shadowAttributes), isolate, currentWorldTy
pe); |
| 4414 | 4414 |
| 4415 // Install a security handler with V8. | 4415 // Install a security handler with V8. |
| 4416 templ->SetAccessCheckCallbacks(V8Window::namedSecurityCheckCustom, V8Window:
:indexedSecurityCheckCustom, v8::External::New(const_cast<WrapperTypeInfo*>(&V8W
indow::wrapperTypeInfo))); | 4416 templ->SetAccessCheckCallbacks(V8Window::namedSecurityCheckCustom, V8Window:
:indexedSecurityCheckCustom, v8::External::New(isolate, const_cast<WrapperTypeIn
fo*>(&V8Window::wrapperTypeInfo))); |
| 4417 templ->SetInternalFieldCount(V8Window::internalFieldCount); | 4417 templ->SetInternalFieldCount(V8Window::internalFieldCount); |
| 4418 } | 4418 } |
| 4419 END | 4419 END |
| 4420 } | 4420 } |
| 4421 | 4421 |
| 4422 if (!$parentClassTemplate) { | 4422 if (!$parentClassTemplate) { |
| 4423 $parentClassTemplate = "v8::Local<v8::FunctionTemplate>()"; | 4423 $parentClassTemplate = "v8::Local<v8::FunctionTemplate>()"; |
| 4424 } | 4424 } |
| 4425 | 4425 |
| 4426 # Generate the template configuration method | 4426 # Generate the template configuration method |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4547 # Special cases | 4547 # Special cases |
| 4548 if ($interfaceName eq "Window") { | 4548 if ($interfaceName eq "Window") { |
| 4549 $code .= <<END; | 4549 $code .= <<END; |
| 4550 | 4550 |
| 4551 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount); | 4551 prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount); |
| 4552 functionTemplate->SetHiddenPrototype(true); | 4552 functionTemplate->SetHiddenPrototype(true); |
| 4553 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount); | 4553 instanceTemplate->SetInternalFieldCount(V8Window::internalFieldCount); |
| 4554 // Set access check callbacks, but turned off initially. | 4554 // Set access check callbacks, but turned off initially. |
| 4555 // When a context is detached from a frame, turn on the access check. | 4555 // When a context is detached from a frame, turn on the access check. |
| 4556 // Turning on checks also invalidates inline caches of the object. | 4556 // Turning on checks also invalidates inline caches of the object. |
| 4557 instanceTemplate->SetAccessCheckCallbacks(V8Window::namedSecurityCheckCustom
, V8Window::indexedSecurityCheckCustom, v8::External::New(const_cast<WrapperType
Info*>(&V8Window::wrapperTypeInfo)), false); | 4557 instanceTemplate->SetAccessCheckCallbacks(V8Window::namedSecurityCheckCustom
, V8Window::indexedSecurityCheckCustom, v8::External::New(isolate, const_cast<Wr
apperTypeInfo*>(&V8Window::wrapperTypeInfo)), false); |
| 4558 END | 4558 END |
| 4559 } | 4559 } |
| 4560 if ($interfaceName eq "HTMLDocument" or $interfaceName eq "DedicatedWorkerGl
obalScope" or $interfaceName eq "SharedWorkerGlobalScope") { | 4560 if ($interfaceName eq "HTMLDocument" or $interfaceName eq "DedicatedWorkerGl
obalScope" or $interfaceName eq "SharedWorkerGlobalScope") { |
| 4561 $code .= <<END; | 4561 $code .= <<END; |
| 4562 functionTemplate->SetHiddenPrototype(true); | 4562 functionTemplate->SetHiddenPrototype(true); |
| 4563 END | 4563 END |
| 4564 } | 4564 } |
| 4565 | 4565 |
| 4566 $code .= <<END; | 4566 $code .= <<END; |
| 4567 | 4567 |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6306 my $interface = shift; | 6306 my $interface = shift; |
| 6307 | 6307 |
| 6308 return 1 if $interface->extendedAttributes->{"CustomToV8"}; | 6308 return 1 if $interface->extendedAttributes->{"CustomToV8"}; |
| 6309 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; | 6309 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; |
| 6310 return 1 if InheritsInterface($interface, "Document"); | 6310 return 1 if InheritsInterface($interface, "Document"); |
| 6311 | 6311 |
| 6312 return 0; | 6312 return 0; |
| 6313 } | 6313 } |
| 6314 | 6314 |
| 6315 1; | 6315 1; |
| OLD | NEW |