Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: Source/bindings/templates/interface_base.cpp

Issue 1107523002: IDL: Drop [PerContextEnabled] extended attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {% include 'copyright_block.txt' %} 1 {% include 'copyright_block.txt' %}
2 #include "config.h" 2 #include "config.h"
3 {% filter conditional(conditional_string) %} 3 {% filter conditional(conditional_string) %}
4 #include "{{v8_class_or_partial}}.h" 4 #include "{{v8_class_or_partial}}.h"
5 5
6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %}
7 #include "{{filename}}" 7 #include "{{filename}}"
8 {% endfor %} 8 {% endfor %}
9 9
10 namespace blink { 10 namespace blink {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 {% block shadow_attributes %}{% endblock %} 202 {% block shadow_attributes %}{% endblock %}
203 {##############################################################################} 203 {##############################################################################}
204 {% block install_attributes %} 204 {% block install_attributes %}
205 {% from 'attributes.cpp' import attribute_configuration with context %} 205 {% from 'attributes.cpp' import attribute_configuration with context %}
206 {% if has_attribute_configuration %} 206 {% if has_attribute_configuration %}
207 static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = { 207 static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = {
208 {% for attribute in attributes 208 {% for attribute in attributes
209 if not (attribute.is_expose_js_accessors or 209 if not (attribute.is_expose_js_accessors or
210 attribute.is_static or 210 attribute.is_static or
211 attribute.runtime_enabled_function or 211 attribute.runtime_enabled_function or
212 attribute.per_context_enabled_function or
213 attribute.exposed_test or 212 attribute.exposed_test or
214 (interface_name == 'Window' and attribute.is_unforgeable)) 213 (interface_name == 'Window' and attribute.is_unforgeable))
215 and attribute.should_be_exposed_to_script %} 214 and attribute.should_be_exposed_to_script %}
216 {% filter conditional(attribute.conditional_string) %} 215 {% filter conditional(attribute.conditional_string) %}
217 {{attribute_configuration(attribute)}}, 216 {{attribute_configuration(attribute)}},
218 {% endfilter %} 217 {% endfilter %}
219 {% endfor %} 218 {% endfor %}
220 }; 219 };
221 220
222 {% endif %} 221 {% endif %}
223 {% endblock %} 222 {% endblock %}
224 {##############################################################################} 223 {##############################################################################}
225 {% block install_accessors %} 224 {% block install_accessors %}
226 {% from 'attributes.cpp' import attribute_configuration with context %} 225 {% from 'attributes.cpp' import attribute_configuration with context %}
227 {% if has_accessor_configuration %} 226 {% if has_accessor_configuration %}
228 static const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] = { 227 static const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] = {
229 {% for attribute in attributes 228 {% for attribute in attributes
230 if (attribute.is_expose_js_accessors and 229 if (attribute.is_expose_js_accessors and
231 not (attribute.is_static or 230 not (attribute.is_static or
232 attribute.runtime_enabled_function or 231 attribute.runtime_enabled_function or
233 attribute.per_context_enabled_function or
234 attribute.exposed_test) and 232 attribute.exposed_test) and
235 attribute.should_be_exposed_to_script) %} 233 attribute.should_be_exposed_to_script) %}
236 {{attribute_configuration(attribute)}}, 234 {{attribute_configuration(attribute)}},
237 {% endfor %} 235 {% endfor %}
238 }; 236 };
239 237
240 {% endif %} 238 {% endif %}
241 {% endblock %} 239 {% endblock %}
242 {##############################################################################} 240 {##############################################################################}
243 {% block install_methods %} 241 {% block install_methods %}
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 {% endif %} 316 {% endif %}
319 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 317 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
320 ALLOW_UNUSED_LOCAL(instanceTemplate); 318 ALLOW_UNUSED_LOCAL(instanceTemplate);
321 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 319 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
322 ALLOW_UNUSED_LOCAL(prototypeTemplate); 320 ALLOW_UNUSED_LOCAL(prototypeTemplate);
323 {% if has_access_check_callbacks %} 321 {% if has_access_check_callbacks %}
324 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo))); 322 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo)));
325 {% endif %} 323 {% endif %}
326 {% for attribute in attributes 324 {% for attribute in attributes
327 if attribute.runtime_enabled_function and 325 if attribute.runtime_enabled_function and
328 not attribute.per_context_enabled_function and
329 not attribute.exposed_test and 326 not attribute.exposed_test and
330 not attribute.is_static %} 327 not attribute.is_static %}
331 {% filter conditional(attribute.conditional_string) %} 328 {% filter conditional(attribute.conditional_string) %}
332 if ({{attribute.runtime_enabled_function}}()) { 329 if ({{attribute.runtime_enabled_function}}()) {
333 {% if attribute.is_expose_js_accessors %} 330 {% if attribute.is_expose_js_accessors %}
334 static const V8DOMConfiguration::AccessorConfiguration accessorConfigura tion =\ 331 static const V8DOMConfiguration::AccessorConfiguration accessorConfigura tion =\
335 {{attribute_configuration(attribute)}}; 332 {{attribute_configuration(attribute)}};
336 V8DOMConfiguration::installAccessor(isolate, prototypeTemplate, defaultS ignature, accessorConfiguration); 333 V8DOMConfiguration::installAccessor(isolate, prototypeTemplate, defaultS ignature, accessorConfiguration);
337 {% else %} 334 {% else %}
338 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 335 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 config.flags = v8::PropertyHandlerFlags::kAllCanRead; 398 config.flags = v8::PropertyHandlerFlags::kAllCanRead;
402 {% endif %} 399 {% endif %}
403 {# TODO(yukishiino): Determine how to treat Window interface. #} 400 {# TODO(yukishiino): Determine how to treat Window interface. #}
404 {% if not is_override_builtins and interface_name != 'Window' %} 401 {% if not is_override_builtins and interface_name != 'Window' %}
405 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking)); 402 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking));
406 {% endif %} 403 {% endif %}
407 functionTemplate->{{set_on_template}}()->SetHandler(config); 404 functionTemplate->{{set_on_template}}()->SetHandler(config);
408 } 405 }
409 {% endif %} 406 {% endif %}
410 {% if iterator_method %} 407 {% if iterator_method %}
411 {% filter per_context_enabled(iterator_method.per_context_enabled_function) %}
412 {% filter exposed(iterator_method.exposed_test) %} 408 {% filter exposed(iterator_method.exposed_test) %}
413 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %} 409 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %}
414 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Inte rnal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; 410 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Inte rnal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
415 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration); 411 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration);
416 {% endfilter %}{# runtime_enabled() #} 412 {% endfilter %}{# runtime_enabled() #}
417 {% endfilter %}{# exposed() #} 413 {% endfilter %}{# exposed() #}
418 {% endfilter %}{# per_context_enabled() #}
419 {% endif %} 414 {% endif %}
420 {# End special operations #} 415 {# End special operations #}
421 {% if has_custom_legacy_call_as_function %} 416 {% if has_custom_legacy_call_as_function %}
422 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}: :legacyCallCustom); 417 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}: :legacyCallCustom);
423 {% endif %} 418 {% endif %}
424 {% if interface_name == 'HTMLAllCollection' %} 419 {% if interface_name == 'HTMLAllCollection' %}
425 {# Needed for legacy support of document.all #} 420 {# Needed for legacy support of document.all #}
426 functionTemplate->InstanceTemplate()->MarkAsUndetectable(); 421 functionTemplate->InstanceTemplate()->MarkAsUndetectable();
427 {% endif %} 422 {% endif %}
428 {% for method in custom_registration_methods %} 423 {% for method in custom_registration_methods %}
429 {# install_custom_signature #} 424 {# install_custom_signature #}
430 {% filter conditional(method.conditional_string) %} 425 {% filter conditional(method.conditional_string) %}
431 {% filter per_context_enabled(method.overloads.per_context_enabled_function_ all
432 if method.overloads else
433 method.per_context_enabled_function) %}
434 {% filter exposed(method.overloads.exposed_test_all 426 {% filter exposed(method.overloads.exposed_test_all
435 if method.overloads else 427 if method.overloads else
436 method.exposed_test) %} 428 method.exposed_test) %}
437 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 429 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
438 if method.overloads else 430 if method.overloads else
439 method.runtime_enabled_function) %} 431 method.runtime_enabled_function) %}
440 {% if method.is_do_not_check_security %} 432 {% if method.is_do_not_check_security %}
441 {{install_do_not_check_security_signature(method) | indent}} 433 {{install_do_not_check_security_signature(method) | indent}}
442 {% else %}{# is_do_not_check_security #} 434 {% else %}{# is_do_not_check_security #}
443 {{install_custom_signature(method) | indent}} 435 {{install_custom_signature(method) | indent}}
444 {% endif %}{# is_do_not_check_security #} 436 {% endif %}{# is_do_not_check_security #}
445 {% endfilter %}{# runtime_enabled() #} 437 {% endfilter %}{# runtime_enabled() #}
446 {% endfilter %}{# exposed() #} 438 {% endfilter %}{# exposed() #}
447 {% endfilter %}{# per_context_enabled() #}
448 {% endfilter %}{# conditional() #} 439 {% endfilter %}{# conditional() #}
449 {% endfor %} 440 {% endfor %}
450 {% for attribute in attributes if attribute.is_static %} 441 {% for attribute in attributes if attribute.is_static %}
451 {% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' % 442 {% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' %
452 (cpp_class, attribute.name) %} 443 (cpp_class, attribute.name) %}
453 {% set setter_callback = '%sV8Internal::%sAttributeSetterCallback' % 444 {% set setter_callback = '%sV8Internal::%sAttributeSetterCallback' %
454 (cpp_class, attribute.name) 445 (cpp_class, attribute.name)
455 if attribute.has_setter else '0' %} 446 if attribute.has_setter else '0' %}
456 {% filter conditional(attribute.conditional_string) %} 447 {% filter conditional(attribute.conditional_string) %}
457 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "{{attribute .name}}"), {{getter_callback}}, {{setter_callback}}, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignatur e>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 448 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "{{attribute .name}}"), {{getter_callback}}, {{setter_callback}}, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Local<v8::AccessorSignatur e>(), static_cast<v8::AccessControl>(v8::DEFAULT));
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 {% endfor %} 492 {% endfor %}
502 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 493 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
503 {{attribute_getter_implemented_in_private_script(attribute)}} 494 {{attribute_getter_implemented_in_private_script(attribute)}}
504 {% if attribute.has_setter %} 495 {% if attribute.has_setter %}
505 {{attribute_setter_implemented_in_private_script(attribute)}} 496 {{attribute_setter_implemented_in_private_script(attribute)}}
506 {% endif %} 497 {% endif %}
507 {% endfor %} 498 {% endfor %}
508 {% block partial_interface %}{% endblock %} 499 {% block partial_interface %}{% endblock %}
509 } // namespace blink 500 } // namespace blink
510 {% endfilter %} 501 {% endfilter %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698