| OLD | NEW |
| 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} |
| 2 | 2 |
| 3 {##############################################################################} | 3 {##############################################################################} |
| 4 {% macro generate_method(method, world_suffix) %} | 4 {% macro generate_method(method, world_suffix) %} |
| 5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) { | 5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) { |
| 6 {% filter format_remove_duplicates([ | 6 {% filter format_remove_duplicates([ |
| 7 'ExceptionState exceptionState', | 7 'ExceptionState exceptionState', |
| 8 'ScriptState* scriptState = ']) %} | 8 'ScriptState* scriptState = ']) %} |
| 9 {% set define_exception_state -%} | 9 {% set define_exception_state -%} |
| 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "{{interface_name}}", "{{method.name}}"); | 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "{{interface_name}}", "{{method.name}}"); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 // Neuter the original array buffers on the sender context. | 486 // Neuter the original array buffers on the sender context. |
| 487 SerializedScriptValue::transferArrayBufferContents(info.GetIsolate(), transf
erableArrayBuffers, exceptionState); | 487 SerializedScriptValue::transferArrayBufferContents(info.GetIsolate(), transf
erableArrayBuffers, exceptionState); |
| 488 if (exceptionState.hadException()) | 488 if (exceptionState.hadException()) |
| 489 return; | 489 return; |
| 490 // Neuter the original image bitmaps on the sender context. | 490 // Neuter the original image bitmaps on the sender context. |
| 491 SerializedScriptValue::transferImageBitmapContents(info.GetIsolate(), transf
erableImageBitmaps, exceptionState); | 491 SerializedScriptValue::transferImageBitmapContents(info.GetIsolate(), transf
erableImageBitmaps, exceptionState); |
| 492 if (exceptionState.hadException()) | 492 if (exceptionState.hadException()) |
| 493 return; | 493 return; |
| 494 } | 494 } |
| 495 | 495 |
| 496 // FIXME: Only pass context/exceptionState if instance really requires it. | 496 // FIXME: Only pass scriptState/exceptionState if instance really requires it. |
| 497 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 497 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
| 498 instance->postMessage(context, message.release(), transferables.messagePorts,
exceptionState); | 498 instance->postMessage(scriptState, message.release(), transferables.messagePor
ts, exceptionState); |
| 499 } | 499 } |
| 500 {% endmacro %} | 500 {% endmacro %} |
| 501 | 501 |
| 502 | 502 |
| 503 {##############################################################################} | 503 {##############################################################################} |
| 504 {% macro method_callback(method, world_suffix) %} | 504 {% macro method_callback(method, world_suffix) %} |
| 505 void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(cons
t v8::FunctionCallbackInfo<v8::Value>& info) { | 505 void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(cons
t v8::FunctionCallbackInfo<v8::Value>& info) { |
| 506 {% if not method.overloads %}{# Overloaded methods are measured in overload_re
solution_method() #} | 506 {% if not method.overloads %}{# Overloaded methods are measured in overload_re
solution_method() #} |
| 507 {% if method.measure_as %} | 507 {% if method.measure_as %} |
| 508 UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{me
thod.measure_as('Method')}}); | 508 UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{me
thod.measure_as('Method')}}); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 if method.overloads else | 658 if method.overloads else |
| 659 method.runtime_enabled_feature_name) %} | 659 method.runtime_enabled_feature_name) %} |
| 660 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 660 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
| 661 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); | 661 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); |
| 662 {% endfilter %}{# runtime_enabled() #} | 662 {% endfilter %}{# runtime_enabled() #} |
| 663 {% endfilter %}{# exposed() #} | 663 {% endfilter %}{# exposed() #} |
| 664 {% endfilter %}{# secure_context() #} | 664 {% endfilter %}{# secure_context() #} |
| 665 {% endfor %} | 665 {% endfor %} |
| 666 {% endif %} | 666 {% endif %} |
| 667 {%- endmacro %} | 667 {%- endmacro %} |
| OLD | NEW |