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

Unified 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: Synced. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/tests/idls/core/ArrayBuffer.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/interface_base.cpp
diff --git a/Source/bindings/templates/interface_base.cpp b/Source/bindings/templates/interface_base.cpp
index f2c89913634a817a8b26bf8b923bc60f7d7e7be9..2da59d7c45a0b4f8e8be7f2f39a74ee8555ca1b9 100644
--- a/Source/bindings/templates/interface_base.cpp
+++ b/Source/bindings/templates/interface_base.cpp
@@ -23,16 +23,21 @@ namespace blink {
if parent_interface else '0' %}
{% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
'WrapperTypeObjectPrototype' %}
+{% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_view else '0' %}
-const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}::trace, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} };
+const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}::trace, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} };
{% if is_script_wrappable %}
// This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}}.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
+{% if is_typed_array_type %}
+template<>
+{% endif %}
const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperTypeInfo;
{% endif %}
+{% if not is_array_buffer_or_view %}
namespace {{cpp_class}}V8Internal {
{# Constants #}
@@ -229,6 +234,7 @@ static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = {
{% endif %}
{% endblock %}
+{% endif %}{# not is_array_buffer_or_view #}
{##############################################################################}
{% block named_constructor %}{% endblock %}
{% block initialize_event %}{% endblock %}
@@ -236,6 +242,7 @@ static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = {
{% block configure_shadow_object_template %}{% endblock %}
{##############################################################################}
{% block install_dom_template %}
+{% if not is_array_buffer_or_view %}
{% from 'methods.cpp' import install_custom_signature with context %}
{% from 'constants.cpp' import install_constants with context %}
static void install{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
@@ -306,7 +313,7 @@ static void install{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functio
{{install_constants() | indent}}
{% endif %}
{# Special operations #}
- {# V8 has access-check callback API and it's used on Window instead of
+ {# V8 has access-check callback API and it is used on Window instead of
deleters or enumerators; see ObjectTemplate::SetAccessCheckCallbacks.
In addition, the getter should be set on the prototype template, to get
the implementation straight out of the Window prototype, regardless of
@@ -400,10 +407,12 @@ static void install{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functio
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}
+{% endif %}{# not is_array_buffer_or_view #}
{% endblock %}
{##############################################################################}
{% block get_dom_template %}{% endblock %}
{% block has_instance %}{% endblock %}
+{% block to_impl %}{% endblock %}
{% block to_impl_with_type_check %}{% endblock %}
{##############################################################################}
{% block install_conditional_attributes %}
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/tests/idls/core/ArrayBuffer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698