Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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); | |
|
haraken
2015/05/25 11:37:45
Nit: I'd rename this to postMessageImpl, but you c
vivekg
2015/05/25 11:40:00
Sure, I will change it in the follow up CL. Thanks
| |
| 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 Loading... | |
| 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 %} |
| OLD | NEW |