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

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

Issue 776143003: Remove Isolated Worlds from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 constructor_getter %} 5 {% block constructor_getter %}
6 {% if has_constructor_attributes %} 6 {% if has_constructor_attributes %}
7 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info) 7 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info)
8 { 8 {
9 v8::Handle<v8::Value> data = info.Data(); 9 v8::Handle<v8::Value> data = info.Data();
10 ASSERT(data->IsExternal()); 10 ASSERT(data->IsExternal());
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8At omicString(info.GetIsolate(), "{{attribute.name}}"), {{attribute.name}}); 596 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8At omicString(info.GetIsolate(), "{{attribute.name}}"), {{attribute.name}});
597 {% endfor %} 597 {% endfor %}
598 } 598 }
599 {% if is_constructor_raises_exception %} 599 {% if is_constructor_raises_exception %}
600 RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit, excepti onState); 600 RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit, excepti onState);
601 if (exceptionState.throwIfNeeded()) 601 if (exceptionState.throwIfNeeded())
602 return; 602 return;
603 {% else %} 603 {% else %}
604 RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit); 604 RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit);
605 {% endif %} 605 {% endif %}
606 {% if any_type_attributes and not interface_name == 'ErrorEvent' %}
607 {# If we're in an isolated world, create a SerializedScriptValue and store
608 it in the event for later cloning if the property is accessed from
609 another world. The main world case is handled lazily (in custom code).
610 606
611 We do not clone Error objects (exceptions), for 2 reasons:
612 1) Errors carry a reference to the isolated world's global object, and
613 thus passing it around would cause leakage.
614 2) Errors cannot be cloned (or serialized):
615 http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#safe-passing-of-structured-data #}
616 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) {
617 {% for attribute in any_type_attributes %}
618 if (!{{attribute.name}}.IsEmpty())
619 event->setSerialized{{attribute.name | blink_capitalize}}(Serialized ScriptValue::createAndSwallowExceptions({{attribute.name}}, info.GetIsolate()));
620 {% endfor %}
621 }
622
623 {% endif %}
624 v8::Handle<v8::Object> wrapper = info.Holder(); 607 v8::Handle<v8::Object> wrapper = info.Holder();
625 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(event.release(), &{{v 8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate()); 608 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(event.release(), &{{v 8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate());
626 v8SetReturnValue(info, wrapper); 609 v8SetReturnValue(info, wrapper);
627 } 610 }
628 611
629 {% endif %} 612 {% endif %}
630 {% endblock %} 613 {% endblock %}
631 614
632 615
633 {##############################################################################} 616 {##############################################################################}
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 fromInternalPointer(internalPointer)->deref(); 1199 fromInternalPointer(internalPointer)->deref();
1217 } 1200 }
1218 1201
1219 template<> 1202 template<>
1220 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1203 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1221 { 1204 {
1222 return toV8(impl, creationContext, isolate); 1205 return toV8(impl, creationContext, isolate);
1223 } 1206 }
1224 1207
1225 {% endblock %} 1208 {% endblock %}
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/custom/V8CustomEventCustom.cpp ('k') | sky/engine/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698