| 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 #ifndef {{v8_class}}_h | 7 #ifndef {{v8_class}}_h |
| 8 #define {{v8_class}}_h | 8 #define {{v8_class}}_h |
| 9 | 9 |
| 10 {% filter conditional(conditional_string) %} | 10 {% filter conditional(conditional_string) %} |
| 11 {% for filename in header_includes %} | 11 {% for filename in header_includes %} |
| 12 #include "{{filename}}" | 12 #include "{{filename}}" |
| 13 {% endfor %} | 13 {% endfor %} |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 {% if has_event_constructor %} | 17 {% if has_event_constructor %} |
| 18 class Dictionary; | 18 class Dictionary; |
| 19 {% endif %} | 19 {% endif %} |
| 20 {% if named_constructor %} | 20 {% if named_constructor %} |
| 21 class {{v8_class}}Constructor { | 21 class {{v8_class}}Constructor { |
| 22 public: | 22 public: |
| 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
| 24 static const WrapperTypeInfo wrapperTypeInfo; | 24 static const WrapperTypeInfo wrapperTypeInfo; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 {% endif %} | 27 {% endif %} |
| 28 class {{v8_class}} { | 28 class {{v8_class}} { |
| 29 public: | 29 public: |
| 30 {% if has_private_script %} |
| 31 class PrivateScript { |
| 32 public: |
| 33 {% for method in methods if method.is_implemented_in_private_script %} |
| 34 static bool {{method.name}}Method({{method.argument_declarations_for_pri
vate_script | join(', ')}}); |
| 35 {% endfor %} |
| 36 {% for attribute in attributes if attribute.is_implemented_in_private_sc
ript %} |
| 37 static bool {{attribute.name}}AttributeGetter(LocalFrame* frame, {{cpp_c
lass}}* holderImpl, {{attribute.cpp_type}}* result); |
| 38 {% if not attribute.is_read_only %} |
| 39 static bool {{attribute.name}}AttributeSetter(LocalFrame* frame, {{cpp_c
lass}}* holderImpl, {{attribute.argument_cpp_type}} cppValue); |
| 40 {% endif %} |
| 41 {% endfor %} |
| 42 }; |
| 43 |
| 44 {% endif %} |
| 30 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 31 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); | 46 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); |
| 32 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
| 33 static {{cpp_class}}* toNative(v8::Handle<v8::Object> object) | 48 static {{cpp_class}}* toNative(v8::Handle<v8::Object> object) |
| 34 { | 49 { |
| 35 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 36 } | 51 } |
| 37 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val
ue>); | 52 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val
ue>); |
| 38 static const WrapperTypeInfo wrapperTypeInfo; | 53 static const WrapperTypeInfo wrapperTypeInfo; |
| 39 static void derefObject(void*); | 54 static void derefObject(void*); |
| 40 {% if has_visit_dom_wrapper %} | 55 {% if has_visit_dom_wrapper %} |
| 41 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is
olate*); | 56 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is
olate*); |
| 42 {% endif %} | 57 {% endif %} |
| 43 {% if is_active_dom_object %} | 58 {% if is_active_dom_object %} |
| 44 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); | 59 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 45 {% endif %} | 60 {% endif %} |
| 46 {% if is_event_target %} | 61 {% if is_event_target %} |
| 47 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 62 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 48 {% endif %} | 63 {% endif %} |
| 49 {% if interface_name == 'Window' %} | 64 {% if interface_name == 'Window' %} |
| 50 static v8::Handle<v8::ObjectTemplate> getShadowObjectTemplate(v8::Isolate*); | 65 static v8::Handle<v8::ObjectTemplate> getShadowObjectTemplate(v8::Isolate*); |
| 51 {% endif %} | 66 {% endif %} |
| 52 {% for method in methods %} | 67 {% for method in methods %} |
| 53 {% if method.is_custom %} | 68 {% if method.is_custom %} |
| 54 {% filter conditional(method.conditional_string) %} | 69 {% filter conditional(method.conditional_string) %} |
| 55 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V
alue>&); | 70 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V
alue>&); |
| 56 {% endfilter %} | 71 {% endfilter %} |
| 57 {% endif %} | 72 {% endif %} |
| 58 {% if method.is_implemented_in_private_script %} | |
| 59 static bool {{method.name}}MethodImplementedInPrivateScript({{method.argumen
t_declarations_for_private_script | join(', ')}}); | |
| 60 {% endif %} | |
| 61 {% endfor %} | 73 {% endfor %} |
| 62 {% if constructors or has_custom_constructor or has_event_constructor %} | 74 {% if constructors or has_custom_constructor or has_event_constructor %} |
| 63 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 75 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 64 {% endif %} | 76 {% endif %} |
| 65 {% if has_custom_constructor %} | 77 {% if has_custom_constructor %} |
| 66 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); | 78 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); |
| 67 {% endif %} | 79 {% endif %} |
| 68 {% for attribute in attributes %} | 80 {% for attribute in attributes %} |
| 69 {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_
by #} | 81 {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_
by #} |
| 70 {% filter conditional(attribute.conditional_string) %} | 82 {% filter conditional(attribute.conditional_string) %} |
| 71 static void {{attribute.name}}AttributeGetterCustom(const v8::PropertyCallba
ckInfo<v8::Value>&); | 83 static void {{attribute.name}}AttributeGetterCustom(const v8::PropertyCallba
ckInfo<v8::Value>&); |
| 72 {% endfilter %} | 84 {% endfilter %} |
| 73 {% endif %} | 85 {% endif %} |
| 74 {% if attribute.has_custom_setter %}{# FIXME: and not attribute.implemented_
by #} | 86 {% if attribute.has_custom_setter %}{# FIXME: and not attribute.implemented_
by #} |
| 75 {% filter conditional(attribute.conditional_string) %} | 87 {% filter conditional(attribute.conditional_string) %} |
| 76 static void {{attribute.name}}AttributeSetterCustom(v8::Local<v8::Value>, co
nst v8::PropertyCallbackInfo<void>&); | 88 static void {{attribute.name}}AttributeSetterCustom(v8::Local<v8::Value>, co
nst v8::PropertyCallbackInfo<void>&); |
| 77 {% endfilter %} | 89 {% endfilter %} |
| 78 {% endif %} | 90 {% endif %} |
| 79 {% if attribute.is_implemented_in_private_script %} | |
| 80 static bool {{attribute.name}}AttributeGetterImplementedInPrivateScript(Loca
lFrame* frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result); | |
| 81 {% if not attribute.is_read_only or attribute.put_forwards %} | |
| 82 static bool {{attribute.name}}AttributeSetterImplementedInPrivateScript(Loca
lFrame* frame, {{cpp_class}}* holderImpl, {{attribute.argument_cpp_type}} cppVal
ue); | |
| 83 {% endif %} | |
| 84 {% endif %} | |
| 85 {% endfor %} | 91 {% endfor %} |
| 86 {# Custom special operations #} | 92 {# Custom special operations #} |
| 87 {% if indexed_property_getter and indexed_property_getter.is_custom %} | 93 {% if indexed_property_getter and indexed_property_getter.is_custom %} |
| 88 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback
Info<v8::Value>&); | 94 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback
Info<v8::Value>&); |
| 89 {% endif %} | 95 {% endif %} |
| 90 {% if indexed_property_setter and indexed_property_setter.is_custom %} | 96 {% if indexed_property_setter and indexed_property_setter.is_custom %} |
| 91 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, cons
t v8::PropertyCallbackInfo<v8::Value>&); | 97 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, cons
t v8::PropertyCallbackInfo<v8::Value>&); |
| 92 {% endif %} | 98 {% endif %} |
| 93 {% if indexed_property_deleter and indexed_property_deleter.is_custom %} | 99 {% if indexed_property_deleter and indexed_property_deleter.is_custom %} |
| 94 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbac
kInfo<v8::Boolean>&); | 100 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbac
kInfo<v8::Boolean>&); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 293 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 288 } | 294 } |
| 289 | 295 |
| 290 {% if has_event_constructor %} | 296 {% if has_event_constructor %} |
| 291 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 297 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 292 | 298 |
| 293 {% endif %} | 299 {% endif %} |
| 294 } | 300 } |
| 295 {% endfilter %} | 301 {% endfilter %} |
| 296 #endif // {{v8_class}}_h | 302 #endif // {{v8_class}}_h |
| OLD | NEW |