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

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

Issue 698023005: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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
« no previous file with comments | « Source/bindings/scripts/v8_types.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 {% block indexed_property_getter %} 5 {% block indexed_property_getter %}
6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %}
7 {% set getter = indexed_property_getter %} 7 {% set getter = indexed_property_getter %}
8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
9 { 9 {
10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#safe-passing-of-structured-data #} 550 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#safe-passing-of-structured-data #}
551 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) { 551 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) {
552 {% for attribute in any_type_attributes %} 552 {% for attribute in any_type_attributes %}
553 if (!{{attribute.name}}.IsEmpty()) 553 if (!{{attribute.name}}.IsEmpty())
554 event->setSerialized{{attribute.name | blink_capitalize}}(Serialized ScriptValue::createAndSwallowExceptions(info.GetIsolate(), {{attribute.name}})); 554 event->setSerialized{{attribute.name | blink_capitalize}}(Serialized ScriptValue::createAndSwallowExceptions(info.GetIsolate(), {{attribute.name}}));
555 {% endfor %} 555 {% endfor %}
556 } 556 }
557 557
558 {% endif %} 558 {% endif %}
559 v8::Handle<v8::Object> wrapper = info.Holder(); 559 v8::Handle<v8::Object> wrapper = info.Holder();
560 event->associateWithWrapper(&{{v8_class}}::wrapperTypeInfo, wrapper, info.Ge tIsolate()); 560 event->associateWithWrapper(info.GetIsolate(), &{{v8_class}}::wrapperTypeInf o, wrapper);
561 v8SetReturnValue(info, wrapper); 561 v8SetReturnValue(info, wrapper);
562 } 562 }
563 563
564 {% endif %} 564 {% endif %}
565 {% endblock %} 565 {% endblock %}
566 566
567 567
568 {##############################################################################} 568 {##############################################################################}
569 {% block visit_dom_wrapper %} 569 {% block visit_dom_wrapper %}
570 {% if reachable_node_function or set_wrapper_reference_to_list %} 570 {% if reachable_node_function or set_wrapper_reference_to_list %}
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 // Transfer the ownership of the allocated memory to an ArrayBuffer without 780 // Transfer the ownership of the allocated memory to an ArrayBuffer without
781 // copying. 781 // copying.
782 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); 782 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize();
783 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength() , 0); 783 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength() , 0);
784 RefPtr<{{cpp_class}}> buffer = {{cpp_class}}::create(contents); 784 RefPtr<{{cpp_class}}> buffer = {{cpp_class}}::create(contents);
785 // Since this transfer doesn't allocate new memory, do not call 785 // Since this transfer doesn't allocate new memory, do not call
786 // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory. 786 // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory.
787 buffer->buffer()->setDeallocationObserverWithoutAllocationNotification( 787 buffer->buffer()->setDeallocationObserverWithoutAllocationNotification(
788 DOMArrayBufferDeallocationObserver::instance()); 788 DOMArrayBufferDeallocationObserver::instance());
789 buffer->associateWithWrapper(buffer->wrapperTypeInfo(), object, v8::Isolate: :GetCurrent()); 789 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI nfo(), object);
790 790
791 return buffer.get(); 791 return buffer.get();
792 } 792 }
793 793
794 {% elif interface_name == 'ArrayBufferView' %} 794 {% elif interface_name == 'ArrayBufferView' %}
795 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Handle<v8::Object> object) 795 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Handle<v8::Object> object)
796 { 796 {
797 ASSERT(object->IsArrayBufferView()); 797 ASSERT(object->IsArrayBufferView());
798 ScriptWrappable* scriptWrappable = toScriptWrappable(object); 798 ScriptWrappable* scriptWrappable = toScriptWrappable(object);
799 if (scriptWrappable) 799 if (scriptWrappable)
(...skipping 27 matching lines...) Expand all
827 {% elif is_array_buffer_or_view %} 827 {% elif is_array_buffer_or_view %}
828 {{cpp_class}}* {{v8_class}}::toImpl(v8::Handle<v8::Object> object) 828 {{cpp_class}}* {{v8_class}}::toImpl(v8::Handle<v8::Object> object)
829 { 829 {
830 ASSERT(object->Is{{interface_name}}()); 830 ASSERT(object->Is{{interface_name}}());
831 ScriptWrappable* scriptWrappable = toScriptWrappable(object); 831 ScriptWrappable* scriptWrappable = toScriptWrappable(object);
832 if (scriptWrappable) 832 if (scriptWrappable)
833 return scriptWrappable->toImpl<{{cpp_class}}>(); 833 return scriptWrappable->toImpl<{{cpp_class}}>();
834 834
835 v8::Handle<v8::{{interface_name}}> v8View = object.As<v8::{{interface_name}} >(); 835 v8::Handle<v8::{{interface_name}}> v8View = object.As<v8::{{interface_name}} >();
836 RefPtr<{{cpp_class}}> typedArray = {{cpp_class}}::create(V8ArrayBuffer::toIm pl(v8View->Buffer()), v8View->ByteOffset(), v8View->{% if interface_name == 'Dat aView' %}Byte{% endif %}Length()); 836 RefPtr<{{cpp_class}}> typedArray = {{cpp_class}}::create(V8ArrayBuffer::toIm pl(v8View->Buffer()), v8View->ByteOffset(), v8View->{% if interface_name == 'Dat aView' %}Byte{% endif %}Length());
837 typedArray->associateWithWrapper(typedArray->wrapperTypeInfo(), object, v8:: Isolate::GetCurrent()); 837 typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrap perTypeInfo(), object);
838 838
839 return typedArray->toImpl<{{cpp_class}}>(); 839 return typedArray->toImpl<{{cpp_class}}>();
840 } 840 }
841 841
842 {% endif %} 842 {% endif %}
843 {% endblock %} 843 {% endblock %}
844 844
845 845
846 {##############################################################################} 846 {##############################################################################}
847 {% block to_impl_with_type_check %} 847 {% block to_impl_with_type_check %}
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 } 966 }
967 967
968 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 968 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
969 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 969 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
970 { 970 {
971 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 971 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
972 } 972 }
973 {% endfor %} 973 {% endfor %}
974 {% endif %} 974 {% endif %}
975 {% endblock %} 975 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698