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