Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sky/engine/bindings/templates/interface.h

Issue 683593002: Remove GarbageCollected support from the bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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}}* toNative(v8::Handle<v8::Object> object) 48 static {{cpp_class}}* toNative(v8::Handle<v8::Object> object)
49 { 49 {
50 return fromInternalPointer(blink::toScriptWrappableBase(object)); 50 return fromInternalPointer(blink::toScriptWrappableBase(object));
51 } 51 }
52 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val ue>); 52 static {{cpp_class}}* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val ue>);
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);
57 {% if has_visit_dom_wrapper %} 56 {% if has_visit_dom_wrapper %}
58 static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8:: Persistent<v8::Object>&, v8::Isolate*); 57 static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8:: Persistent<v8::Object>&, v8::Isolate*);
59 {% endif %} 58 {% endif %}
60 {% if is_active_dom_object %} 59 {% if is_active_dom_object %}
61 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); 60 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
62 {% endif %} 61 {% endif %}
63 {% if is_event_target %} 62 {% if is_event_target %}
64 static EventTarget* toEventTarget(v8::Handle<v8::Object>); 63 static EventTarget* toEventTarget(v8::Handle<v8::Object>);
65 {% endif %} 64 {% endif %}
66 {% if interface_name == 'Window' %} 65 {% if interface_name == 'Window' %}
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 {% if is_event_target and not is_node %} 126 {% if is_event_target and not is_node %}
128 {# Event listeners on DOM nodes are explicitly supported in the GC controlle r. #} 127 {# Event listeners on DOM nodes are explicitly supported in the GC controlle r. #}
129 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + {{custom_internal_field_counter}}; 128 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + {{custom_internal_field_counter}};
130 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} 129 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %}
131 {% endif %} 130 {% endif %}
132 {# persistentHandleIndex must be the last field, if it is present. 131 {# persistentHandleIndex must be the last field, if it is present.
133 Detailed explanation: https://codereview.chromium.org/139173012 132 Detailed explanation: https://codereview.chromium.org/139173012
134 FIXME: Remove this internal field, and share one field for either: 133 FIXME: Remove this internal field, and share one field for either:
135 * a persistent handle (if the object is in oilpan) or 134 * 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) #} 135 * 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}}; 136 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 #} 137 {# End custom internal fields #}
151 static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl ) 138 static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl )
152 { 139 {
153 return impl->toScriptWrappableBase(); 140 return impl->toScriptWrappableBase();
154 } 141 }
155 142
156 static inline {{cpp_class}}* fromInternalPointer(ScriptWrappableBase* script Wrappable) 143 static inline {{cpp_class}}* fromInternalPointer(ScriptWrappableBase* script Wrappable)
157 { 144 {
158 return scriptWrappable->toImpl<{{cpp_class}}>(); 145 return scriptWrappable->toImpl<{{cpp_class}}>();
159 } 146 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 274 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
288 } 275 }
289 276
290 {% if has_event_constructor %} 277 {% if has_event_constructor %}
291 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); 278 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = "");
292 279
293 {% endif %} 280 {% endif %}
294 } // namespace blink 281 } // namespace blink
295 {% endfilter %} 282 {% endfilter %}
296 #endif // {{v8_class}}_h 283 #endif // {{v8_class}}_h
OLDNEW
« no previous file with comments | « sky/engine/bindings/scripts/v8_utilities.py ('k') | sky/engine/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698