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

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

Issue 181513002: Kill [SetWrapperReferenceFromReference] IDL extended attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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
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 '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class) %} 10 '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class) %}
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(), WrapperConfiguration::De pendent);
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 reachable_node_reference_function or 681 {% if reachable_node_function or
682 set_wrapper_reference_to_list %} 682 set_wrapper_reference_to_list %}
683 void {{v8_class}}::visitDOMWrapper(void* object, const v8::Persistent<v8::Object >& wrapper, v8::Isolate* isolate) 683 void {{v8_class}}::visitDOMWrapper(void* object, const v8::Persistent<v8::Object >& wrapper, v8::Isolate* isolate)
684 { 684 {
685 {{cpp_class}}* impl = fromInternalPointer(object); 685 {{cpp_class}}* impl = fromInternalPointer(object);
686 {% if set_wrapper_reference_to_list %} 686 {% if set_wrapper_reference_to_list %}
687 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper); 687 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper);
688 V8WrapperInstantiationScope scope(creationContext, isolate); 688 V8WrapperInstantiationScope scope(creationContext, isolate);
689 {% for set_wrapper_reference_to in set_wrapper_reference_to_list %} 689 {% for set_wrapper_reference_to in set_wrapper_reference_to_list %}
690 {{set_wrapper_reference_to.cpp_type}} {{set_wrapper_reference_to.name}} = im pl->{{set_wrapper_reference_to.name}}(); 690 {{set_wrapper_reference_to.cpp_type}} {{set_wrapper_reference_to.name}} = im pl->{{set_wrapper_reference_to.name}}();
691 if ({{set_wrapper_reference_to.name}}) { 691 if ({{set_wrapper_reference_to.name}}) {
692 if (!DOMDataStore::containsWrapper<{{set_wrapper_reference_to.v8_type}}> ({{set_wrapper_reference_to.name}}, isolate)) 692 if (!DOMDataStore::containsWrapper<{{set_wrapper_reference_to.v8_type}}> ({{set_wrapper_reference_to.name}}, isolate))
693 wrap({{set_wrapper_reference_to.name}}, creationContext, isolate); 693 wrap({{set_wrapper_reference_to.name}}, creationContext, isolate);
694 DOMDataStore::setWrapperReference<{{set_wrapper_reference_to.v8_type}}>( wrapper, {{set_wrapper_reference_to.name}}, isolate); 694 DOMDataStore::setWrapperReference<{{set_wrapper_reference_to.v8_type}}>( wrapper, {{set_wrapper_reference_to.name}}, isolate);
695 } 695 }
696 {% endfor %} 696 {% endfor %}
697 {% endif %} 697 {% endif %}
698 {% if reachable_node_function %} 698 {% if reachable_node_function %}
699 if (Node* owner = impl->{{reachable_node_function}}()) { 699 // The {{reachable_node_function}}() method may return a reference or a poin ter.
700 if (Node* owner = WTF::getPtr(impl->{{reachable_node_function}}())) {
700 Node* root = V8GCController::opaqueRootForGC(owner, isolate); 701 Node* root = V8GCController::opaqueRootForGC(owner, isolate);
701 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r oot)), wrapper); 702 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r oot)), wrapper);
702 return; 703 return;
703 } 704 }
704 {% elif reachable_node_reference_function %}
705 Node* root = V8GCController::opaqueRootForGC(&impl->{{reachable_node_referen ce_function}}(), isolate);
706 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(root) ), wrapper);
707 {% endif %} 705 {% endif %}
708 {% if reachable_node_function or set_wrapper_reference_to_list %} 706 {% if reachable_node_function or set_wrapper_reference_to_list %}
Nils Barth (inactive) 2014/02/28 02:18:16 This conditional is no longer necessary; I'll fix
Nils Barth (inactive) 2014/03/03 01:58:30 Fixed in: Cleanup [SetWrapperReferenceFromReferenc
709 setObjectGroup(object, wrapper, isolate); 707 setObjectGroup(object, wrapper, isolate);
710 {% endif %} 708 {% endif %}
711 } 709 }
712 710
713 {% endif %} 711 {% endif %}
714 {% endblock %} 712 {% endblock %}
715 713
716 714
717 {##############################################################################} 715 {##############################################################################}
718 {% block shadow_attributes %} 716 {% block shadow_attributes %}
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 {% endfilter %} 1320 {% endfilter %}
1323 } 1321 }
1324 1322
1325 template<> 1323 template<>
1326 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1324 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1327 { 1325 {
1328 return toV8(impl, creationContext, isolate); 1326 return toV8(impl, creationContext, isolate);
1329 } 1327 }
1330 1328
1331 {% endblock %} 1329 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/TestInterfacePython4.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698