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

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

Issue 1150863004: toImplArguments should return HeapVector for Union types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 {% endif %}{# not method.overloads #} 459 {% endif %}{# not method.overloads #}
460 {% if world_suffix in method.activity_logging_world_list %} 460 {% if world_suffix in method.activity_logging_world_list %}
461 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); 461 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext());
462 V8PerContextData* contextData = scriptState->perContextData(); 462 V8PerContextData* contextData = scriptState->perContextData();
463 {% if method.activity_logging_world_check %} 463 {% if method.activity_logging_world_check %}
464 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) 464 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger())
465 {% else %} 465 {% else %}
466 if (contextData && contextData->activityLogger()) { 466 if (contextData && contextData->activityLogger()) {
467 {% endif %} 467 {% endif %}
468 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 468 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
469 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<v8::Local<v8:: Value>>(info, 0, exceptionState); 469 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Loc al<v8::Value>>>(info, 0, exceptionState);
470 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data()); 470 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na me}}", info.Length(), loggerArgs.data());
471 } 471 }
472 {% endif %} 472 {% endif %}
473 {% if method.is_custom %} 473 {% if method.is_custom %}
474 {{v8_class}}::{{method.name}}MethodCustom(info); 474 {{v8_class}}::{{method.name}}MethodCustom(info);
475 {% elif method.is_post_message %} 475 {% elif method.is_post_message %}
476 postMessageMethodCommon("{{interface_name}}", {{v8_class}}::toImpl(info.Hold er()), info); 476 postMessageMethodCommon("{{interface_name}}", {{v8_class}}::toImpl(info.Hold er()), info);
477 {% else %} 477 {% else %}
478 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in fo); 478 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in fo);
479 {% endif %} 479 {% endif %}
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 if method.overloads else 662 if method.overloads else
663 method.runtime_enabled_function) %} 663 method.runtime_enabled_function) %}
664 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef ined(), defaultSignature, {{method.number_of_required_arguments}}); 664 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef ined(), defaultSignature, {{method.number_of_required_arguments}});
665 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked(); 665 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked();
666 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function)); 666 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function));
667 {% endfilter %}{# runtime_enabled() #} 667 {% endfilter %}{# runtime_enabled() #}
668 {% endfilter %}{# exposed() #} 668 {% endfilter %}{# exposed() #}
669 {% endfor %} 669 {% endfor %}
670 {% endif %} 670 {% endif %}
671 {%- endmacro %} 671 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698