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

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

Issue 718383003: bindings: fixed incorrect dependency of SerializedScriptValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added fast/js/structured-clone.html Created 6 years 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 {% 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 another world. The main world case is handled lazily (in custom code). 544 another world. The main world case is handled lazily (in custom code).
545 545
546 We do not clone Error objects (exceptions), for 2 reasons: 546 We do not clone Error objects (exceptions), for 2 reasons:
547 1) Errors carry a reference to the isolated world's global object, and 547 1) Errors carry a reference to the isolated world's global object, and
548 thus passing it around would cause leakage. 548 thus passing it around would cause leakage.
549 2) Errors cannot be cloned (or serialized): 549 2) Errors cannot be cloned (or serialized):
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 ScriptValueFactory::instance().createAndSwallowExceptions(info.GetIsolate(), {{a ttribute.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(info.GetIsolate(), &{{v8_class}}::wrapperTypeInf o, wrapper); 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 %}
(...skipping 401 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/tests/results/core/V8TestInterfaceEventConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698