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

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

Issue 234403004: Rename V8TRYCATCH_* macros in v8/V8BindingMacros.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: BOOL*_BOOL -> BOOL* Created 6 years, 8 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
« 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 {% 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 ('%sV8Internal::%sConstructorGetterCallback' % 10 ('%sV8Internal::%sConstructorGetterCallback' %
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 { 338 {
339 {% if not is_override_builtins %} 339 {% if not is_override_builtins %}
340 if (info.Holder()->HasRealNamedProperty(name)) 340 if (info.Holder()->HasRealNamedProperty(name))
341 return; 341 return;
342 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 342 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
343 return; 343 return;
344 344
345 {% endif %} 345 {% endif %}
346 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); 346 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder());
347 {# v8_value_to_local_cpp_value('DOMString', 'name', 'propertyName') #} 347 {# v8_value_to_local_cpp_value('DOMString', 'name', 'propertyName') #}
348 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name) ; 348 TOSTRING_VOID(V8StringResource<>, propertyName, name);
349 {{setter.v8_value_to_local_cpp_value}}; 349 {{setter.v8_value_to_local_cpp_value}};
350 {% if setter.has_exception_state %} 350 {% if setter.has_exception_state %}
351 v8::String::Utf8Value namedProperty(name); 351 v8::String::Utf8Value namedProperty(name);
352 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "{{interface_name}}", info.Holder(), info.GetIsolate()); 352 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "{{interface_name}}", info.Holder(), info.GetIsolate());
353 {% endif %} 353 {% endif %}
354 {% set setter_name = setter.name or 'anonymousNamedSetter' %} 354 {% set setter_name = setter.name or 'anonymousNamedSetter' %}
355 {% set setter_arguments = 355 {% set setter_arguments =
356 ['propertyName', 'propertyValue', 'exceptionState'] 356 ['propertyName', 'propertyValue', 'exceptionState']
357 if setter.is_raises_exception else 357 if setter.is_raises_exception else
358 ['propertyName', 'propertyValue'] %} 358 ['propertyName', 'propertyValue'] %}
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 619 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
620 { 620 {
621 v8::Isolate* isolate = info.GetIsolate(); 621 v8::Isolate* isolate = info.GetIsolate();
622 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf ace_name}}", info.Holder(), isolate); 622 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf ace_name}}", info.Holder(), isolate);
623 if (info.Length() < 1) { 623 if (info.Length() < 1) {
624 exceptionState.throwTypeError("An event name must be provided."); 624 exceptionState.throwTypeError("An event name must be provided.");
625 exceptionState.throwIfNeeded(); 625 exceptionState.throwIfNeeded();
626 return; 626 return;
627 } 627 }
628 628
629 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); 629 TOSTRING_VOID(V8StringResource<>, type, info[0]);
630 {% for attribute in any_type_attributes %} 630 {% for attribute in any_type_attributes %}
631 v8::Local<v8::Value> {{attribute.name}}; 631 v8::Local<v8::Value> {{attribute.name}};
632 {% endfor %} 632 {% endfor %}
633 {{cpp_class}}Init eventInit; 633 {{cpp_class}}Init eventInit;
634 if (info.Length() >= 2) { 634 if (info.Length() >= 2) {
635 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], isolate)); 635 TONATIVE_VOID(Dictionary, options, Dictionary(info[1], isolate));
636 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info)) { 636 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info)) {
637 exceptionState.throwIfNeeded(); 637 exceptionState.throwIfNeeded();
638 return; 638 return;
639 } 639 }
640 {# Store attributes of type |any| on the wrapper to avoid leaking them 640 {# Store attributes of type |any| on the wrapper to avoid leaking them
641 between isolated worlds. #} 641 between isolated worlds. #}
642 {% for attribute in any_type_attributes %} 642 {% for attribute in any_type_attributes %}
643 options.get("{{attribute.name}}", {{attribute.name}}); 643 options.get("{{attribute.name}}", {{attribute.name}});
644 if (!{{attribute.name}}.IsEmpty()) 644 if (!{{attribute.name}}.IsEmpty())
645 V8HiddenValue::setHiddenValue(isolate, info.Holder(), v8AtomicString (isolate, "{{attribute.name}}"), {{attribute.name}}); 645 V8HiddenValue::setHiddenValue(isolate, info.Holder(), v8AtomicString (isolate, "{{attribute.name}}"), {{attribute.name}});
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 {% endif %} 1317 {% endif %}
1318 } 1318 }
1319 1319
1320 template<> 1320 template<>
1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1322 { 1322 {
1323 return toV8(impl, creationContext, isolate); 1323 return toV8(impl, creationContext, isolate);
1324 } 1324 }
1325 1325
1326 {% endblock %} 1326 {% 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