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

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

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Win GPU tests (DOMDataView). Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
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
11 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} 11 {% for filename in cpp_includes if filename != '%s.h' % v8_class %}
12 #include "{{filename}}" 12 #include "{{filename}}"
13 {% endfor %} 13 {% endfor %}
14 14
15 namespace blink { 15 namespace blink {
16 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class 16 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
17 if is_active_dom_object else '0' %} 17 if is_active_dom_object else '0' %}
18 {% set to_event_target = '%s::toEventTarget' % v8_class 18 {% set to_event_target = '%s::toEventTarget' % v8_class
19 if is_event_target else '0' %} 19 if is_event_target else '0' %}
20 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class 20 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class
21 if has_visit_dom_wrapper else '0' %} 21 if has_visit_dom_wrapper else '0' %}
22 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface 22 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface
23 if parent_interface else '0' %} 23 if parent_interface else '0' %}
24 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else 24 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
25 'WrapperTypeObjectPrototype' %} 25 'WrapperTypeObjectPrototype' %}
26 {% set dom_template = '%s::domTemplate' % v8_class if is_v8object else '0' %}
26 27
27 const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v 8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8 _class}}::createPersistentHandle, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_c lass}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, Wra pperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; 28 const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{d om_template}}, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}: :createPersistentHandle, {{to_active_dom_object}}, {{to_event_target}}, {{visit_ dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::i nstallConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeI nfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperT ypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} };
28 29
29 {% if is_script_wrappable %} 30 {% if is_script_wrappable %}
30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class} }.h. 31 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class} }.h.
31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 32 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
32 // bindings/core/v8/ScriptWrappable.h. 33 // bindings/core/v8/ScriptWrappable.h.
34 {% if is_typed_array_type %}
35 template<>
36 {% endif %}
33 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo; 37 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo;
34 38
35 {% endif %} 39 {% endif %}
40 {% if is_v8object %}
36 namespace {{cpp_class}}V8Internal { 41 namespace {{cpp_class}}V8Internal {
37 42
38 {# Constants #} 43 {# Constants #}
39 {% from 'constants.cpp' import constant_getter_callback 44 {% from 'constants.cpp' import constant_getter_callback
40 with context %} 45 with context %}
41 {% for constant in special_getter_constants %} 46 {% for constant in special_getter_constants %}
42 {{constant_getter_callback(constant)}} 47 {{constant_getter_callback(constant)}}
43 {% endfor %} 48 {% endfor %}
44 {# Attributes #} 49 {# Attributes #}
45 {% from 'attributes.cpp' import constructor_getter_callback, 50 {% from 'attributes.cpp' import constructor_getter_callback,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = { 211 static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = {
207 {% for method in method_configuration_methods %} 212 {% for method in method_configuration_methods %}
208 {% filter conditional(method.conditional_string) %} 213 {% filter conditional(method.conditional_string) %}
209 {{method_configuration(method)}}, 214 {{method_configuration(method)}},
210 {% endfilter %} 215 {% endfilter %}
211 {% endfor %} 216 {% endfor %}
212 }; 217 };
213 218
214 {% endif %} 219 {% endif %}
215 {% endblock %} 220 {% endblock %}
221 {% endif %}{# is_v8object #}
216 {##############################################################################} 222 {##############################################################################}
217 {% block named_constructor %}{% endblock %} 223 {% block named_constructor %}{% endblock %}
218 {% block initialize_event %}{% endblock %} 224 {% block initialize_event %}{% endblock %}
219 {% block constructor_callback %}{% endblock %} 225 {% block constructor_callback %}{% endblock %}
220 {% block configure_shadow_object_template %}{% endblock %} 226 {% block configure_shadow_object_template %}{% endblock %}
221 {##############################################################################} 227 {##############################################################################}
222 {% block install_dom_template %} 228 {% block install_dom_template %}
229 {% if is_v8object %}
223 {% from 'methods.cpp' import install_custom_signature with context %} 230 {% from 'methods.cpp' import install_custom_signature with context %}
224 {% from 'constants.cpp' import install_constants with context %} 231 {% from 'constants.cpp' import install_constants with context %}
225 static void install{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functio nTemplate, v8::Isolate* isolate) 232 static void install{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functio nTemplate, v8::Isolate* isolate)
226 { 233 {
227 functionTemplate->ReadOnlyPrototype(); 234 functionTemplate->ReadOnlyPrototype();
228 235
229 v8::Local<v8::Signature> defaultSignature; 236 v8::Local<v8::Signature> defaultSignature;
230 {% set parent_template = 237 {% set parent_template =
231 'V8%s::domTemplate(isolate)' % parent_interface 238 'V8%s::domTemplate(isolate)' % parent_interface
232 if parent_interface else 'v8::Local<v8::FunctionTemplate>()' %} 239 if parent_interface else 'v8::Local<v8::FunctionTemplate>()' %}
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 {% elif interface_name in [ 384 {% elif interface_name in [
378 'HTMLDocument', 'DedicatedWorkerGlobalScope', 385 'HTMLDocument', 'DedicatedWorkerGlobalScope',
379 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %} 386 'SharedWorkerGlobalScope', 'ServiceWorkerGlobalScope'] %}
380 functionTemplate->SetHiddenPrototype(true); 387 functionTemplate->SetHiddenPrototype(true);
381 {% endif %} 388 {% endif %}
382 389
383 // Custom toString template 390 // Custom toString template
384 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 391 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
385 } 392 }
386 393
394 {% endif %}{# is_v8object #}
387 {% endblock %} 395 {% endblock %}
388 {##############################################################################} 396 {##############################################################################}
389 {% block get_dom_template %}{% endblock %} 397 {% block get_dom_template %}{% endblock %}
390 {% block has_instance %}{% endblock %} 398 {% block has_instance %}{% endblock %}
399 {% block to_impl %}{% endblock %}
391 {% block to_impl_with_type_check %}{% endblock %} 400 {% block to_impl_with_type_check %}{% endblock %}
392 {% block install_conditional_attributes %}{% endblock %} 401 {% block install_conditional_attributes %}{% endblock %}
393 {% block install_conditional_methods %}{% endblock %} 402 {% block install_conditional_methods %}{% endblock %}
394 {% block to_active_dom_object %}{% endblock %} 403 {% block to_active_dom_object %}{% endblock %}
395 {% block to_event_target %}{% endblock %} 404 {% block to_event_target %}{% endblock %}
396 {% block get_shadow_object_template %}{% endblock %} 405 {% block get_shadow_object_template %}{% endblock %}
397 {% block wrap %}{% endblock %} 406 {% block wrap %}{% endblock %}
398 {% block create_wrapper %}{% endblock %} 407 {% block create_wrapper %}{% endblock %}
399 {% block deref_object_and_to_v8_no_inline %}{% endblock %} 408 {% block deref_object_and_to_v8_no_inline %}{% endblock %}
400 {% for method in methods if method.is_implemented_in_private_script %} 409 {% for method in methods if method.is_implemented_in_private_script %}
401 {{method_implemented_in_private_script(method)}} 410 {{method_implemented_in_private_script(method)}}
402 {% endfor %} 411 {% endfor %}
403 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 412 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
404 {{attribute_getter_implemented_in_private_script(attribute)}} 413 {{attribute_getter_implemented_in_private_script(attribute)}}
405 {% if not attribute.is_read_only or attribute.put_forwards %} 414 {% if not attribute.is_read_only or attribute.put_forwards %}
406 {{attribute_setter_implemented_in_private_script(attribute)}} 415 {{attribute_setter_implemented_in_private_script(attribute)}}
407 {% endif %} 416 {% endif %}
408 {% endfor %} 417 {% endfor %}
409 } // namespace blink 418 } // namespace blink
410 {% endfilter %} 419 {% endfilter %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698