| 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::kExecutionCon
text, "{{interface_name}}", "{{method.name}}"); | 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionCon
text, "{{interface_name}}", "{{method.name}}"); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 return; | 442 return; |
| 443 } else { | 443 } else { |
| 444 // This instance doesn't support sending array buffers and image bitmaps | 444 // This instance doesn't support sending array buffers and image bitmaps |
| 445 // by move semantics. Emulate it by copy-and-neuter semantics that sends | 445 // by move semantics. Emulate it by copy-and-neuter semantics that sends |
| 446 // array buffers and image bitmaps via structured clone and then neuters | 446 // array buffers and image bitmaps via structured clone and then neuters |
| 447 // the original objects | 447 // the original objects |
| 448 | 448 |
| 449 // Clear references to array buffers and image bitmaps from transferables | 449 // Clear references to array buffers and image bitmaps from transferables |
| 450 // so that the serializer can consider the array buffers as | 450 // so that the serializer can consider the array buffers as |
| 451 // non-transferable and serialize them into the message. | 451 // non-transferable and serialize them into the message. |
| 452 ArrayBufferArray transferableArrayBuffers = transferables.array_buffers; | 452 ArrayBufferArray transferableArrayBuffers = SerializedScriptValue::ExtractNo
nSharedArrayBuffers(transferables); |
| 453 transferables.array_buffers.clear(); | |
| 454 ImageBitmapArray transferableImageBitmaps = transferables.image_bitmaps; | 453 ImageBitmapArray transferableImageBitmaps = transferables.image_bitmaps; |
| 455 transferables.image_bitmaps.clear(); | 454 transferables.image_bitmaps.clear(); |
| 456 SerializedScriptValue::SerializeOptions options; | 455 SerializedScriptValue::SerializeOptions options; |
| 457 options.transferables = &transferables; | 456 options.transferables = &transferables; |
| 458 message = SerializedScriptValue::Serialize(info.GetIsolate(), info[0], optio
ns, exceptionState); | 457 message = SerializedScriptValue::Serialize(info.GetIsolate(), info[0], optio
ns, exceptionState); |
| 459 if (exceptionState.HadException()) | 458 if (exceptionState.HadException()) |
| 460 return; | 459 return; |
| 461 | 460 |
| 462 // Neuter the original array buffers on the sender context. | 461 // Neuter the original array buffers on the sender context. |
| 463 SerializedScriptValue::TransferArrayBufferContents(info.GetIsolate(), transf
erableArrayBuffers, exceptionState); | 462 SerializedScriptValue::TransferArrayBufferContents(info.GetIsolate(), transf
erableArrayBuffers, exceptionState); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 {{method_configuration(method) | indent(2)}} | 651 {{method_configuration(method) | indent(2)}} |
| 653 }; | 652 }; |
| 654 for (const auto& methodConfig : {{method.name}}MethodConfiguration) | 653 for (const auto& methodConfig : {{method.name}}MethodConfiguration) |
| 655 V8DOMConfiguration::InstallMethod(isolate, world, v8::Local<v8::Object>(), pro
totypeObject, interfaceObject, signature, methodConfig); | 654 V8DOMConfiguration::InstallMethod(isolate, world, v8::Local<v8::Object>(), pro
totypeObject, interfaceObject, signature, methodConfig); |
| 656 {% endfilter %}{# runtime_enabled() #} | 655 {% endfilter %}{# runtime_enabled() #} |
| 657 {% endfilter %}{# exposed() #} | 656 {% endfilter %}{# exposed() #} |
| 658 {% endfilter %}{# secure_context() #} | 657 {% endfilter %}{# secure_context() #} |
| 659 {% endfor %} | 658 {% endfor %} |
| 660 {% endif %} | 659 {% endif %} |
| 661 {%- endmacro %} | 660 {%- endmacro %} |
| OLD | NEW |