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

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

Issue 587653002: IDL: Conversion to Dictionary is trivial (can't fail) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 exceptionState.throwIfNeeded(); 576 exceptionState.throwIfNeeded();
577 return; 577 return;
578 } 578 }
579 579
580 TOSTRING_VOID(V8StringResource<>, type, info[0]); 580 TOSTRING_VOID(V8StringResource<>, type, info[0]);
581 {% for attribute in any_type_attributes %} 581 {% for attribute in any_type_attributes %}
582 v8::Local<v8::Value> {{attribute.name}}; 582 v8::Local<v8::Value> {{attribute.name}};
583 {% endfor %} 583 {% endfor %}
584 {{cpp_class}}Init eventInit; 584 {{cpp_class}}Init eventInit;
585 if (info.Length() >= 2) { 585 if (info.Length() >= 2) {
586 TONATIVE_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate() )); 586 Dictionary options(info[1], info.GetIsolate());
587 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info)) { 587 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info)) {
588 exceptionState.throwIfNeeded(); 588 exceptionState.throwIfNeeded();
589 return; 589 return;
590 } 590 }
591 {# Store attributes of type |any| on the wrapper to avoid leaking them 591 {# Store attributes of type |any| on the wrapper to avoid leaking them
592 between isolated worlds. #} 592 between isolated worlds. #}
593 {% for attribute in any_type_attributes %} 593 {% for attribute in any_type_attributes %}
594 options.get("{{attribute.name}}", {{attribute.name}}); 594 options.get("{{attribute.name}}", {{attribute.name}});
595 if (!{{attribute.name}}.IsEmpty()) 595 if (!{{attribute.name}}.IsEmpty())
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}});
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 {% endif %} 1263 {% endif %}
1264 } 1264 }
1265 1265
1266 template<> 1266 template<>
1267 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1267 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1268 { 1268 {
1269 return toV8(impl, creationContext, isolate); 1269 return toV8(impl, creationContext, isolate);
1270 } 1270 }
1271 1271
1272 {% endblock %} 1272 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698