| OLD | NEW |
| 1 {# http://www.chromium.org/blink/coding-style#TOC-License #} | 1 {# http://www.chromium.org/blink/coding-style#TOC-License #} |
| 2 /* | 2 /* |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 {% if named_property_getter and | 124 {% if named_property_getter and |
| 125 named_property_getter.is_custom_property_enumerator %} | 125 named_property_getter.is_custom_property_enumerator %} |
| 126 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8:
:Array>&); | 126 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8:
:Array>&); |
| 127 {% endif %} | 127 {% endif %} |
| 128 {# END custom special operations #} | 128 {# END custom special operations #} |
| 129 {% if has_custom_legacy_call_as_function %} | 129 {% if has_custom_legacy_call_as_function %} |
| 130 static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&); | 130 static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&); |
| 131 {% endif %} | 131 {% endif %} |
| 132 {# Custom internal fields #} | 132 {# Custom internal fields #} |
| 133 {% set custom_internal_field_counter = 0 %} | 133 {% set custom_internal_field_counter = 0 %} |
| 134 {# persistentHandleIndex must be the first field, if it is present #} | |
| 135 {% if is_will_be_garbage_collected %} | |
| 136 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; | |
| 137 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} | |
| 138 {% endif %} | |
| 139 {% if is_event_target and not is_node %} | 134 {% if is_event_target and not is_node %} |
| 140 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} | 135 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} |
| 141 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; | 136 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; |
| 142 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} | 137 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} |
| 143 {% endif %} | 138 {% endif %} |
| 139 {# persistentHandleIndex must be the last field, if it is present. |
| 140 Detailed explanation: https://codereview.chromium.org/139173012 |
| 141 FIXME: Remove this internal field, and share one field for either: |
| 142 * a persistent handle (if the object is in oilpan) or |
| 143 * a C++ pointer to the DOM object (if the object is not in oilpan) #} |
| 144 {% if is_will_be_garbage_collected %} |
| 145 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; |
| 146 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} |
| 147 {% endif %} |
| 144 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; | 148 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; |
| 145 {# End custom internal fields #} | 149 {# End custom internal fields #} |
| 146 static inline void* toInternalPointer({{cpp_class}}* impl) | 150 static inline void* toInternalPointer({{cpp_class}}* impl) |
| 147 { | 151 { |
| 148 {% if parent_interface %} | 152 {% if parent_interface %} |
| 149 return V8{{parent_interface}}::toInternalPointer(impl); | 153 return V8{{parent_interface}}::toInternalPointer(impl); |
| 150 {% else %} | 154 {% else %} |
| 151 return impl; | 155 return impl; |
| 152 {% endif %} | 156 {% endif %} |
| 153 } | 157 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 305 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 302 } | 306 } |
| 303 | 307 |
| 304 {% if has_event_constructor %} | 308 {% if has_event_constructor %} |
| 305 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 309 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 306 | 310 |
| 307 {% endif %} | 311 {% endif %} |
| 308 } | 312 } |
| 309 {% endfilter %} | 313 {% endfilter %} |
| 310 #endif // {{v8_class}}_h | 314 #endif // {{v8_class}}_h |
| OLD | NEW |