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) %} |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 {% if is_event_target and not is_node %} | 108 {% if is_event_target and not is_node %} |
109 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} | 109 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} |
110 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; | 110 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; |
111 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} | 111 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} |
112 {% endif %} | 112 {% endif %} |
113 {# persistentHandleIndex must be the last field, if it is present. | 113 {# persistentHandleIndex must be the last field, if it is present. |
114 Detailed explanation: https://codereview.chromium.org/139173012 | 114 Detailed explanation: https://codereview.chromium.org/139173012 |
115 FIXME: Remove this internal field, and share one field for either: | 115 FIXME: Remove this internal field, and share one field for either: |
116 * a persistent handle (if the object is in oilpan) or | 116 * a persistent handle (if the object is in oilpan) or |
117 * a C++ pointer to the DOM object (if the object is not in oilpan) #} | 117 * a C++ pointer to the DOM object (if the object is not in oilpan) #} |
118 {% if not gc_type == 'RefCountedObject' %} | 118 {% if gc_type == 'GarbageCollectedObject' %} |
119 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; | 119 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; |
120 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} | 120 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}} + 1; |
| 121 {% elif gc_type == 'WillBeGarbageCollectedObject' %} |
| 122 #if ENABLE(OILPAN) |
| 123 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; |
| 124 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}} + 1; |
| 125 #else |
| 126 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; |
| 127 #endif |
| 128 {% else %} |
| 129 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; |
121 {% endif %} | 130 {% endif %} |
122 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; | |
123 {# End custom internal fields #} | 131 {# End custom internal fields #} |
124 static inline void* toInternalPointer({{cpp_class}}* impl) | 132 static inline void* toInternalPointer({{cpp_class}}* impl) |
125 { | 133 { |
126 {% if parent_interface %} | 134 {% if parent_interface %} |
127 return V8{{parent_interface}}::toInternalPointer(impl); | 135 return V8{{parent_interface}}::toInternalPointer(impl); |
128 {% else %} | 136 {% else %} |
129 return impl; | 137 return impl; |
130 {% endif %} | 138 {% endif %} |
131 } | 139 } |
132 | 140 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 285 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
278 } | 286 } |
279 | 287 |
280 {% if has_event_constructor %} | 288 {% if has_event_constructor %} |
281 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 289 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
282 | 290 |
283 {% endif %} | 291 {% endif %} |
284 } | 292 } |
285 {% endfilter %} | 293 {% endfilter %} |
286 #endif // {{v8_class}}_h | 294 #endif // {{v8_class}}_h |
OLD | NEW |