Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / templates / interface_base.cpp
index dce2cc9..0d9b238 100644 (file)
@@ -12,7 +12,7 @@
 #include "{{filename}}"
 {% endfor %}
 
-namespace WebCore {
+namespace blink {
 
 static void initializeScriptWrappableForInterface({{cpp_class}}* object)
 {
@@ -22,7 +22,7 @@ static void initializeScriptWrappableForInterface({{cpp_class}}* object)
         ASSERT_NOT_REACHED();
 }
 
-} // namespace WebCore
+} // namespace blink
 
 {#
 In ScriptWrappable::init, the use of a local function declaration has an
@@ -32,12 +32,12 @@ More info on the MSVC bug here (Bug 664619):
 The namespace of local function declarations in C++ by Uray M. János
 http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c
 #}
-void webCoreInitializeScriptWrappableForInterface(WebCore::{{cpp_class}}* object)
+void webCoreInitializeScriptWrappableForInterface(blink::{{cpp_class}}* object)
 {
-    WebCore::initializeScriptWrappableForInterface(object);
+    blink::initializeScriptWrappableForInterface(object);
 }
 
-namespace WebCore {
+namespace blink {
 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
                               if is_active_dom_object else '0' %}
 {% set to_event_target = '%s::toEventTarget' % v8_class
@@ -48,7 +48,7 @@ namespace WebCore {
                                   if parent_interface else '0' %}
 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
                                 'WrapperTypeObjectPrototype' %}
-const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::derefObject, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installPerContextEnabledMethods, {{parent_wrapper_type_info}}, {{wrapper_type_prototype}}, {{gc_type}} };
+const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::derefObject, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{parent_wrapper_type_info}}, {{wrapper_type_prototype}}, {{gc_type}} };
 
 namespace {{cpp_class}}V8Internal {
 
@@ -57,9 +57,12 @@ template <typename T> void V8_USE(T) { }
 {# Attributes #}
 {% from 'attributes.cpp' import constructor_getter_callback,
        attribute_getter, attribute_getter_callback,
-       attribute_setter, attribute_setter_callback
-   with context %}
+       attribute_setter, attribute_setter_callback,
+       attribute_getter_implemented_in_private_script,
+       attribute_setter_implemented_in_private_script
+       with context %}
 {% for attribute in attributes if not attribute.constructor_type %}
+{% if attribute.should_be_exposed_to_script %}
 {% for world_suffix in attribute.world_suffixes %}
 {% if not attribute.has_custom_getter %}
 {{attribute_getter(attribute, world_suffix)}}
@@ -72,6 +75,7 @@ template <typename T> void V8_USE(T) { }
 {{attribute_setter_callback(attribute, world_suffix)}}
 {% endif %}
 {% endfor %}
+{% endif %}
 {% endfor %}
 {% block constructor_getter %}{% endblock %}
 {% for attribute in attributes if attribute.needs_constructor_getter_callback %}
@@ -83,9 +87,11 @@ template <typename T> void V8_USE(T) { }
 {% block security_check_functions %}{% endblock %}
 {# Methods #}
 {% from 'methods.cpp' import generate_method, overload_resolution_method,
-       method_callback, origin_safe_method_getter, generate_constructor
+       method_callback, origin_safe_method_getter, generate_constructor,
+       method_implemented_in_private_script
        with context %}
 {% for method in methods %}
+{% if method.should_be_exposed_to_script %}
 {% for world_suffix in method.world_suffixes %}
 {% if not method.is_custom %}
 {{generate_method(method, world_suffix)}}
@@ -101,6 +107,7 @@ template <typename T> void V8_USE(T) { }
 {{origin_safe_method_getter(method, world_suffix)}}
 {% endif %}
 {% endfor %}
+{% endif %}
 {% endfor %}
 {% block origin_safe_method_setter %}{% endblock %}
 {# Constructors #}
@@ -130,24 +137,33 @@ template <typename T> void V8_USE(T) { }
 
 {% block visit_dom_wrapper %}{% endblock %}
 {% block shadow_attributes %}{% endblock %}
-{% block class_attributes %}{% endblock %}
-{% block class_accessors %}{% endblock %}
-{% block class_methods %}{% endblock %}
+{% block install_attributes %}{% endblock %}
+{% block install_accessors %}{% endblock %}
+{% block install_methods %}{% endblock %}
 {% block named_constructor %}{% endblock %}
 {% block initialize_event %}{% endblock %}
 {% block constructor_callback %}{% endblock %}
 {% block configure_shadow_object_template %}{% endblock %}
-{% block configure_class_template %}{% endblock %}
-{% block get_template %}{% endblock %}
+{% block install_dom_template %}{% endblock %}
+{% block get_dom_template %}{% endblock %}
 {% block has_instance %}{% endblock %}
 {% block to_native_with_type_check %}{% endblock %}
-{% block install_per_context_attributes %}{% endblock %}
-{% block install_per_context_methods %}{% endblock %}
+{% block install_conditional_attributes %}{% endblock %}
+{% block install_conditional_methods %}{% endblock %}
 {% block to_active_dom_object %}{% endblock %}
 {% block to_event_target %}{% endblock %}
 {% block get_shadow_object_template %}{% endblock %}
 {% block wrap %}{% endblock %}
 {% block create_wrapper %}{% endblock %}
 {% block deref_object_and_to_v8_no_inline %}{% endblock %}
-} // namespace WebCore
+{% for method in methods if method.is_implemented_in_private_script %}
+{{method_implemented_in_private_script(method)}}
+{% endfor %}
+{% for attribute in attributes if attribute.is_implemented_in_private_script %}
+{{attribute_getter_implemented_in_private_script(attribute)}}
+{% if not attribute.is_read_only or attribute.put_forwards %}
+{{attribute_setter_implemented_in_private_script(attribute)}}
+{% endif %}
+{% endfor %}
+} // namespace blink
 {% endfilter %}