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

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 199633014: Use wrapper_configuration consistently in bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Split off [Constructor] change Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro attribute_configuration(attribute) %} 5 {% macro attribute_configuration(attribute) %}
6 {% set getter_callback = 6 {% set getter_callback =
7 '%sV8Internal::%sAttributeGetterCallback' % 7 '%sV8Internal::%sAttributeGetterCallback' %
8 (cpp_class, attribute.name) 8 (cpp_class, attribute.name)
9 if not attribute.constructor_type else 9 if not attribute.constructor_type else
10 ('%sV8Internal::%sConstructorGetterCallback' % 10 ('%sV8Internal::%sConstructorGetterCallback' %
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#safe-passing-of-structured-data #} 661 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#safe-passing-of-structured-data #}
662 if (DOMWrapperWorld::current(info.GetIsolate())->isIsolatedWorld()) { 662 if (DOMWrapperWorld::current(info.GetIsolate())->isIsolatedWorld()) {
663 {% for attribute in any_type_attributes %} 663 {% for attribute in any_type_attributes %}
664 if (!{{attribute.name}}.IsEmpty()) 664 if (!{{attribute.name}}.IsEmpty())
665 event->setSerialized{{attribute.name | blink_capitalize}}(Serialized ScriptValue::createAndSwallowExceptions({{attribute.name}}, info.GetIsolate())); 665 event->setSerialized{{attribute.name | blink_capitalize}}(Serialized ScriptValue::createAndSwallowExceptions({{attribute.name}}, info.GetIsolate()));
666 {% endfor %} 666 {% endfor %}
667 } 667 }
668 668
669 {% endif %} 669 {% endif %}
670 v8::Handle<v8::Object> wrapper = info.Holder(); 670 v8::Handle<v8::Object> wrapper = info.Holder();
671 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(event.release(), &{{v 8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::De pendent); 671 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(event.release(), &{{v 8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configuration} });
672 v8SetReturnValue(info, wrapper); 672 v8SetReturnValue(info, wrapper);
673 } 673 }
674 674
675 {% endif %} 675 {% endif %}
676 {% endblock %} 676 {% endblock %}
677 677
678 678
679 {##############################################################################} 679 {##############################################################################}
680 {% block visit_dom_wrapper %} 680 {% block visit_dom_wrapper %}
681 {% if reachable_node_function or set_wrapper_reference_to_list %} 681 {% if reachable_node_function or set_wrapper_reference_to_list %}
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 {# We only setDeallocationObservers on array buffers that are held by some 1286 {# We only setDeallocationObservers on array buffers that are held by some
1287 object in the V8 heap, not in the ArrayBuffer constructor itself. 1287 object in the V8 heap, not in the ArrayBuffer constructor itself.
1288 This is because V8 GC only cares about memory it can free on GC, and 1288 This is because V8 GC only cares about memory it can free on GC, and
1289 until the object is exposed to JavaScript, V8 GC doesn't affect it. #} 1289 until the object is exposed to JavaScript, V8 GC doesn't affect it. #}
1290 for (unsigned i = 0, n = impl->numberOfChannels(); i < n; i++) { 1290 for (unsigned i = 0, n = impl->numberOfChannels(); i < n; i++) {
1291 Float32Array* channelData = impl->getChannelData(i); 1291 Float32Array* channelData = impl->getChannelData(i);
1292 channelData->buffer()->setDeallocationObserver(V8ArrayBufferDeallocation Observer::instanceTemplate()); 1292 channelData->buffer()->setDeallocationObserver(V8ArrayBufferDeallocation Observer::instanceTemplate());
1293 } 1293 }
1294 {% endif %} 1294 {% endif %}
1295 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 1295 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
1296 {% set wrapper_configuration = 'WrapperConfiguration::Dependent'
1297 if (has_visit_dom_wrapper or
1298 is_active_dom_object or
1299 is_dependent_lifetime) else
1300 'WrapperConfiguration::Independent' %}
1301 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl, &wrapperTypeInf o, wrapper, isolate, {{wrapper_configuration}}); 1296 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl, &wrapperTypeInf o, wrapper, isolate, {{wrapper_configuration}});
1302 return wrapper; 1297 return wrapper;
1303 } 1298 }
1304 1299
1305 {% endif %} 1300 {% endif %}
1306 {% endblock %} 1301 {% endblock %}
1307 1302
1308 1303
1309 {##############################################################################} 1304 {##############################################################################}
1310 {% block deref_object_and_to_v8_no_inline %} 1305 {% block deref_object_and_to_v8_no_inline %}
1311 void {{v8_class}}::derefObject(void* object) 1306 void {{v8_class}}::derefObject(void* object)
1312 { 1307 {
1313 {% set oilpan_conditional = '!ENABLE(OILPAN)' if is_will_be_garbage_collected 1308 {% set oilpan_conditional = '!ENABLE(OILPAN)' if is_will_be_garbage_collected
1314 else '' %} 1309 else '' %}
1315 {% filter conditional(oilpan_conditional) %} 1310 {% filter conditional(oilpan_conditional) %}
1316 fromInternalPointer(object)->deref(); 1311 fromInternalPointer(object)->deref();
1317 {% endfilter %} 1312 {% endfilter %}
1318 } 1313 }
1319 1314
1320 template<> 1315 template<>
1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1316 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1322 { 1317 {
1323 return toV8(impl, creationContext, isolate); 1318 return toV8(impl, creationContext, isolate);
1324 } 1319 }
1325 1320
1326 {% endblock %} 1321 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698