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

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

Issue 1159653002: [bindings] Introduce PostMessage extended keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Typo correction: missing space in methods.cpp 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
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<v8::Local<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 %}
476 postMessageMethodCommon("{{interface_name}}", {{v8_class}}::toImpl(info.Hold er()), info);
475 {% else %} 477 {% else %}
476 {{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);
477 {% endif %} 479 {% endif %}
478 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 480 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
479 } 481 }
480 {% endfilter %} 482 {% endfilter %}
481 {% endmacro %} 483 {% endmacro %}
482 484
483 485
484 {##############################################################################} 486 {##############################################################################}
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 if method.overloads else 662 if method.overloads else
661 method.runtime_enabled_function) %} 663 method.runtime_enabled_function) %}
662 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}});
663 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked(); 665 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked();
664 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function)); 666 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function));
665 {% endfilter %}{# runtime_enabled() #} 667 {% endfilter %}{# runtime_enabled() #}
666 {% endfilter %}{# exposed() #} 668 {% endfilter %}{# exposed() #}
667 {% endfor %} 669 {% endfor %}
668 {% endif %} 670 {% endif %}
669 {%- endmacro %} 671 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698