| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 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*); |
| 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 47 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
| 48 static {{cpp_class}}* toImpl(v8::Handle<v8::Object> object) | 48 static {{cpp_class}}* toImpl(v8::Handle<v8::Object> object) |
| 49 { | 49 { |
| 50 return blink::toScriptWrappableBase(object)->toImpl<{{cpp_class}}>(); | 50 return blink::toScriptWrappableBase(object)->toImpl<{{cpp_class}}>(); |
| 51 } | 51 } |
| 52 static {{cpp_class}}* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value
>); | 52 static {{cpp_class}}* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value
>); |
| 53 static const WrapperTypeInfo wrapperTypeInfo; | 53 static const WrapperTypeInfo wrapperTypeInfo; |
| 54 static void refObject(ScriptWrappableBase* internalPointer); | 54 static void refObject(ScriptWrappableBase* internalPointer); |
| 55 static void derefObject(ScriptWrappableBase* internalPointer); | 55 static void derefObject(ScriptWrappableBase* internalPointer); |
| 56 static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* in
ternalPointer); | 56 static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer) |
| 57 { |
| 58 {% if gc_type == 'GarbageCollectedObject' %} |
| 59 visitor->trace(internalPointer->toImpl<{{cpp_class}}>()); |
| 60 {% elif gc_type == 'WillBeGarbageCollectedObject' %} |
| 61 #if ENABLE(OILPAN) |
| 62 visitor->trace(internalPointer->toImpl<{{cpp_class}}>()); |
| 63 #endif |
| 64 {% endif %} |
| 65 } |
| 57 {% if has_visit_dom_wrapper %} | 66 {% if has_visit_dom_wrapper %} |
| 58 static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::
Persistent<v8::Object>&, v8::Isolate*); | 67 static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::
Persistent<v8::Object>&, v8::Isolate*); |
| 59 {% endif %} | 68 {% endif %} |
| 60 {% if is_active_dom_object %} | 69 {% if is_active_dom_object %} |
| 61 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); | 70 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 62 {% endif %} | 71 {% endif %} |
| 63 {% if is_event_target %} | 72 {% if is_event_target %} |
| 64 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 73 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 65 {% endif %} | 74 {% endif %} |
| 66 {% if interface_name == 'Window' %} | 75 {% if interface_name == 'Window' %} |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 {% if is_event_target and not is_node %} | 136 {% if is_event_target and not is_node %} |
| 128 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} | 137 {# Event listeners on DOM nodes are explicitly supported in the GC controlle
r. #} |
| 129 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; | 138 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + {{custom_internal_field_counter}}; |
| 130 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} | 139 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} |
| 131 {% endif %} | 140 {% endif %} |
| 132 {# persistentHandleIndex must be the last field, if it is present. | 141 {# persistentHandleIndex must be the last field, if it is present. |
| 133 Detailed explanation: https://codereview.chromium.org/139173012 | 142 Detailed explanation: https://codereview.chromium.org/139173012 |
| 134 FIXME: Remove this internal field, and share one field for either: | 143 FIXME: Remove this internal field, and share one field for either: |
| 135 * a persistent handle (if the object is in oilpan) or | 144 * a persistent handle (if the object is in oilpan) or |
| 136 * a C++ pointer to the DOM object (if the object is not in oilpan) #} | 145 * a C++ pointer to the DOM object (if the object is not in oilpan) #} |
| 137 {% if gc_type == 'GarbageCollectedObject' %} | |
| 138 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; | |
| 139 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}} + 1; | |
| 140 {% elif gc_type == 'WillBeGarbageCollectedObject' %} | |
| 141 #if ENABLE(OILPAN) | |
| 142 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount
+ {{custom_internal_field_counter}}; | |
| 143 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}} + 1; | |
| 144 #else | |
| 145 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; | 146 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; |
| 146 #endif | |
| 147 {% elif gc_type == 'RefCountedObject' %} | |
| 148 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {
{custom_internal_field_counter}}; | |
| 149 {% endif %} | |
| 150 {# End custom internal fields #} | 147 {# End custom internal fields #} |
| 151 static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl
) | 148 static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl
) |
| 152 { | 149 { |
| 153 return impl->toScriptWrappableBase(); | 150 return impl->toScriptWrappableBase(); |
| 154 } | 151 } |
| 155 {% if interface_name == 'Window' %} | 152 {% if interface_name == 'Window' %} |
| 156 static bool namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v
8::Value> key, v8::AccessType, v8::Local<v8::Value> data); | 153 static bool namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v
8::Value> key, v8::AccessType, v8::Local<v8::Value> data); |
| 157 static bool indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t
index, v8::AccessType, v8::Local<v8::Value> data); | 154 static bool indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t
index, v8::AccessType, v8::Local<v8::Value> data); |
| 158 {% endif %} | 155 {% endif %} |
| 159 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*){% if has_conditional_attributes %}; | 156 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*){% if has_conditional_attributes %}; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 278 } |
| 282 | 279 |
| 283 {% if has_event_constructor %} | 280 {% if has_event_constructor %} |
| 284 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 281 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta
te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 285 | 282 |
| 286 {% endif %} | 283 {% endif %} |
| 287 } // namespace blink | 284 } // namespace blink |
| 288 {% endfilter %} | 285 {% endfilter %} |
| 289 | 286 |
| 290 #endif // {{v8_class}}_h | 287 #endif // {{v8_class}}_h |
| OLD | NEW |