OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! | 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 {% filter conditional(conditional_string) %} | 8 {% filter conditional(conditional_string) %} |
9 #include "{{v8_class}}.h" | 9 #include "{{v8_class}}.h" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 static void {{cpp_class}}ForceSetAttributeOnThisCallback(v8::Local<v8::String> n
ame, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 106 static void {{cpp_class}}ForceSetAttributeOnThisCallback(v8::Local<v8::String> n
ame, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
107 { | 107 { |
108 {{cpp_class}}V8Internal::{{cpp_class}}ForceSetAttributeOnThis(name, v8Value,
info); | 108 {{cpp_class}}V8Internal::{{cpp_class}}ForceSetAttributeOnThis(name, v8Value,
info); |
109 } | 109 } |
110 | 110 |
111 {% endif %} | 111 {% endif %} |
112 {% endblock %} | 112 {% endblock %} |
113 {##############################################################################} | 113 {##############################################################################} |
114 {% block security_check_functions %}{% endblock %} | 114 {% block security_check_functions %} |
| 115 {% if has_access_check_callbacks %} |
| 116 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access
Type type, v8::Local<v8::Value>) |
| 117 { |
| 118 {{cpp_class}}* impl = {{v8_class}}::toImpl(host); |
| 119 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(),
impl->frame(), DoNotReportSecurityError); |
| 120 } |
| 121 |
| 122 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8
::AccessType type, v8::Local<v8::Value>) |
| 123 { |
| 124 {{cpp_class}}* impl = {{v8_class}}::toImpl(host); |
| 125 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(),
impl->frame(), DoNotReportSecurityError); |
| 126 } |
| 127 |
| 128 {% endif %} |
| 129 {% endblock %} |
| 130 {##############################################################################} |
115 {# Methods #} | 131 {# Methods #} |
116 {% from 'methods.cpp' import generate_method, overload_resolution_method, | 132 {% from 'methods.cpp' import generate_method, overload_resolution_method, |
117 method_callback, origin_safe_method_getter, generate_constructor, | 133 method_callback, origin_safe_method_getter, generate_constructor, |
118 method_implemented_in_private_script | 134 method_implemented_in_private_script |
119 with context %} | 135 with context %} |
120 {% for method in methods %} | 136 {% for method in methods %} |
121 {% if method.should_be_exposed_to_script %} | 137 {% if method.should_be_exposed_to_script %} |
122 {% for world_suffix in method.world_suffixes %} | 138 {% for world_suffix in method.world_suffixes %} |
123 {% if not method.is_custom %} | 139 {% if not method.is_custom %} |
124 {{generate_method(method, world_suffix)}} | 140 {{generate_method(method, world_suffix)}} |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 398 |
383 // Custom toString template | 399 // Custom toString template |
384 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 400 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
385 } | 401 } |
386 | 402 |
387 {% endblock %} | 403 {% endblock %} |
388 {##############################################################################} | 404 {##############################################################################} |
389 {% block get_dom_template %}{% endblock %} | 405 {% block get_dom_template %}{% endblock %} |
390 {% block has_instance %}{% endblock %} | 406 {% block has_instance %}{% endblock %} |
391 {% block to_impl_with_type_check %}{% endblock %} | 407 {% block to_impl_with_type_check %}{% endblock %} |
392 {% block install_conditional_attributes %}{% endblock %} | 408 {##############################################################################} |
393 {% block install_conditional_methods %}{% endblock %} | 409 {% block install_conditional_attributes %} |
| 410 {% if has_conditional_attributes %} |
| 411 void {{v8_class}}::installConditionallyEnabledProperties(v8::Handle<v8::Object>
instanceObject, v8::Isolate* isolate) |
| 412 { |
| 413 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance
Object->GetPrototype()); |
| 414 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); |
| 415 |
| 416 {% for attribute in attributes if attribute.per_context_enabled_function or
attribute.exposed_test %} |
| 417 {% filter per_context_enabled(attribute.per_context_enabled_function) %} |
| 418 {% filter exposed(attribute.exposed_test) %} |
| 419 static const V8DOMConfiguration::AttributeConfiguration attributeConfigurati
on =\ |
| 420 {{attribute_configuration(attribute)}}; |
| 421 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attrib
uteConfiguration, isolate); |
| 422 {% endfilter %} |
| 423 {% endfilter %} |
| 424 {% endfor %} |
| 425 } |
| 426 |
| 427 {% endif %} |
| 428 {% endblock %} |
| 429 {##############################################################################} |
| 430 {% block install_conditional_methods %} |
| 431 {% if conditionally_enabled_methods %} |
| 432 void {{v8_class}}::installConditionallyEnabledMethods(v8::Handle<v8::Object> pro
totypeObject, v8::Isolate* isolate) |
| 433 { |
| 434 {# Define per-context enabled operations #} |
| 435 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); |
| 436 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); |
| 437 ASSERT(context); |
| 438 |
| 439 {% for method in conditionally_enabled_methods %} |
| 440 {% filter per_context_enabled(method.per_context_enabled_function) %} |
| 441 {% filter exposed(method.exposed_test) %} |
| 442 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio
nTemplate::New(isolate, {{cpp_class}}V8Internal::{{method.name}}MethodCallback,
v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFu
nction()); |
| 443 {% endfilter %} |
| 444 {% endfilter %} |
| 445 {% endfor %} |
| 446 } |
| 447 |
| 448 {% endif %} |
| 449 {% endblock %} |
| 450 {##############################################################################} |
394 {% block to_active_dom_object %}{% endblock %} | 451 {% block to_active_dom_object %}{% endblock %} |
395 {% block to_event_target %}{% endblock %} | 452 {% block to_event_target %}{% endblock %} |
396 {% block get_shadow_object_template %}{% endblock %} | 453 {% block get_shadow_object_template %}{% endblock %} |
397 {% block wrap %}{% endblock %} | 454 {% block wrap %}{% endblock %} |
398 {% block create_wrapper %}{% endblock %} | 455 {% block create_wrapper %}{% endblock %} |
399 {% block deref_object_and_to_v8_no_inline %}{% endblock %} | 456 {% block deref_object_and_to_v8_no_inline %}{% endblock %} |
400 {% for method in methods if method.is_implemented_in_private_script %} | 457 {% for method in methods if method.is_implemented_in_private_script %} |
401 {{method_implemented_in_private_script(method)}} | 458 {{method_implemented_in_private_script(method)}} |
402 {% endfor %} | 459 {% endfor %} |
403 {% for attribute in attributes if attribute.is_implemented_in_private_script %} | 460 {% for attribute in attributes if attribute.is_implemented_in_private_script %} |
404 {{attribute_getter_implemented_in_private_script(attribute)}} | 461 {{attribute_getter_implemented_in_private_script(attribute)}} |
405 {% if not attribute.is_read_only or attribute.put_forwards %} | 462 {% if not attribute.is_read_only or attribute.put_forwards %} |
406 {{attribute_setter_implemented_in_private_script(attribute)}} | 463 {{attribute_setter_implemented_in_private_script(attribute)}} |
407 {% endif %} | 464 {% endif %} |
408 {% endfor %} | 465 {% endfor %} |
409 } // namespace blink | 466 } // namespace blink |
410 {% endfilter %} | 467 {% endfilter %} |
OLD | NEW |