Chromium Code Reviews| 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 class PrivateScript { | |
|
bashi
2014/08/08 06:58:51
nit: We might want to avoid generating PrivateScri
| |
| 31 public: | |
| 32 {% for method in methods %} | |
|
bashi
2014/08/08 06:58:51
nit:
{% for method in methods if method.is_impleme
haraken
2014/08/08 07:01:47
Done.
| |
| 33 {% if method.is_implemented_in_private_script %} | |
| 34 static bool {{method.name}}Method({{method.argument_declarations_for_pri vate_script | join(', ')}}); | |
| 35 {% endif %} | |
| 36 {% endfor %} | |
| 37 {% for attribute in attributes %} | |
|
bashi
2014/08/08 06:58:51
nit: same as above
haraken
2014/08/08 07:01:47
Done.
| |
| 38 {% if attribute.is_implemented_in_private_script %} | |
| 39 static bool {{attribute.name}}AttributeGetter(LocalFrame* frame, {{cpp_c lass}}* holderImpl, {{attribute.cpp_type}}* result); | |
| 40 {% if not attribute.is_read_only or attribute.put_forwards %} | |
| 41 static bool {{attribute.name}}AttributeSetter(LocalFrame* frame, {{cpp_c lass}}* holderImpl, {{attribute.argument_cpp_type}} cppValue); | |
| 42 {% endif %} | |
| 43 {% endif %} | |
| 44 {% endfor %} | |
| 45 }; | |
| 46 | |
| 30 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 47 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 31 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va lue>, v8::Isolate*); | 48 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va lue>, v8::Isolate*); |
| 32 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 49 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
| 33 static {{cpp_class}}* toNative(v8::Handle<v8::Object> object) | 50 static {{cpp_class}}* toNative(v8::Handle<v8::Object> object) |
| 34 { | 51 { |
| 35 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex)); | 52 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex)); |
| 36 } | 53 } |
| 37 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val ue>); | 54 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val ue>); |
| 38 static const WrapperTypeInfo wrapperTypeInfo; | 55 static const WrapperTypeInfo wrapperTypeInfo; |
| 39 static void derefObject(void*); | 56 static void derefObject(void*); |
| 40 {% if has_visit_dom_wrapper %} | 57 {% if has_visit_dom_wrapper %} |
| 41 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*); | 58 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*); |
| 42 {% endif %} | 59 {% endif %} |
| 43 {% if is_active_dom_object %} | 60 {% if is_active_dom_object %} |
| 44 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); | 61 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 45 {% endif %} | 62 {% endif %} |
| 46 {% if is_event_target %} | 63 {% if is_event_target %} |
| 47 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 64 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 48 {% endif %} | 65 {% endif %} |
| 49 {% if interface_name == 'Window' %} | 66 {% if interface_name == 'Window' %} |
| 50 static v8::Handle<v8::ObjectTemplate> getShadowObjectTemplate(v8::Isolate*); | 67 static v8::Handle<v8::ObjectTemplate> getShadowObjectTemplate(v8::Isolate*); |
| 51 {% endif %} | 68 {% endif %} |
| 52 {% for method in methods %} | 69 {% for method in methods %} |
| 53 {% if method.is_custom %} | 70 {% if method.is_custom %} |
| 54 {% filter conditional(method.conditional_string) %} | 71 {% filter conditional(method.conditional_string) %} |
| 55 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V alue>&); | 72 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V alue>&); |
| 56 {% endfilter %} | 73 {% endfilter %} |
| 57 {% endif %} | 74 {% 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 %} | 75 {% endfor %} |
| 62 {% if constructors or has_custom_constructor or has_event_constructor %} | 76 {% if constructors or has_custom_constructor or has_event_constructor %} |
| 63 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 77 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 64 {% endif %} | 78 {% endif %} |
| 65 {% if has_custom_constructor %} | 79 {% if has_custom_constructor %} |
| 66 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); | 80 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); |
| 67 {% endif %} | 81 {% endif %} |
| 68 {% for attribute in attributes %} | 82 {% for attribute in attributes %} |
| 69 {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_ by #} | 83 {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_ by #} |
| 70 {% filter conditional(attribute.conditional_string) %} | 84 {% filter conditional(attribute.conditional_string) %} |
| 71 static void {{attribute.name}}AttributeGetterCustom(const v8::PropertyCallba ckInfo<v8::Value>&); | 85 static void {{attribute.name}}AttributeGetterCustom(const v8::PropertyCallba ckInfo<v8::Value>&); |
| 72 {% endfilter %} | 86 {% endfilter %} |
| 73 {% endif %} | 87 {% endif %} |
| 74 {% if attribute.has_custom_setter %}{# FIXME: and not attribute.implemented_ by #} | 88 {% if attribute.has_custom_setter %}{# FIXME: and not attribute.implemented_ by #} |
| 75 {% filter conditional(attribute.conditional_string) %} | 89 {% filter conditional(attribute.conditional_string) %} |
| 76 static void {{attribute.name}}AttributeSetterCustom(v8::Local<v8::Value>, co nst v8::PropertyCallbackInfo<void>&); | 90 static void {{attribute.name}}AttributeSetterCustom(v8::Local<v8::Value>, co nst v8::PropertyCallbackInfo<void>&); |
| 77 {% endfilter %} | 91 {% endfilter %} |
| 78 {% endif %} | 92 {% 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 %} | 93 {% endfor %} |
| 86 {# Custom special operations #} | 94 {# Custom special operations #} |
| 87 {% if indexed_property_getter and indexed_property_getter.is_custom %} | 95 {% if indexed_property_getter and indexed_property_getter.is_custom %} |
| 88 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback Info<v8::Value>&); | 96 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallback Info<v8::Value>&); |
| 89 {% endif %} | 97 {% endif %} |
| 90 {% if indexed_property_setter and indexed_property_setter.is_custom %} | 98 {% 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>&); | 99 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, cons t v8::PropertyCallbackInfo<v8::Value>&); |
| 92 {% endif %} | 100 {% endif %} |
| 93 {% if indexed_property_deleter and indexed_property_deleter.is_custom %} | 101 {% if indexed_property_deleter and indexed_property_deleter.is_custom %} |
| 94 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbac kInfo<v8::Boolean>&); | 102 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); | 295 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 288 } | 296 } |
| 289 | 297 |
| 290 {% if has_event_constructor %} | 298 {% if has_event_constructor %} |
| 291 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 299 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 292 | 300 |
| 293 {% endif %} | 301 {% endif %} |
| 294 } | 302 } |
| 295 {% endfilter %} | 303 {% endfilter %} |
| 296 #endif // {{v8_class}}_h | 304 #endif // {{v8_class}}_h |
| OLD | NEW |