Commit 6476b132 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Add missing JS generation support for PendingAssociated{Remote,Receiver}

This CL adds the remaining bits needed to add support for the new mojo types
pending_associated_remote & pending_associated_receiver to the JavaScript
generators. Similarly to what was done for CL1507289, these types translate
for now to the existing endpoint types in those language, to allow mojom
conversions without having to adapt those bindings first.

This will unblock cleaning up Blink from the old mojo types, as this is at
least required to migrate references to the XREnvironmentIntegrationProvider
and XRInputSourceButtonListener mojo interfaces (see CLs 1836416 & 1844995d).

Bug: 875030, 955171, 978694
Change-Id: I9ccf1ef2dabcab1ef49b35cae244924bfb44534b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847331Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#705343}
parent f5759fa4
......@@ -101,9 +101,9 @@ idx = {{name}}.setHandlesInternal_(handles, idx)
{{build_call(obj, operation, 'Interface', name, '"' ~ kind.module.namespace ~ '.' ~ kind.name ~ '"', kind.is_nullable|to_js_boolean)}}
{%- elif kind|is_pending_remote_kind -%}
{{build_call(obj, operation, 'Interface', name, '"' ~ kind.kind.module.namespace ~ '.' ~ kind.kind.name ~ '"', kind.is_nullable|to_js_boolean)}}
{%- elif kind|is_associated_interface_request_kind -%}
{%- elif kind|is_associated_interface_request_kind or kind|is_pending_associated_receiver_kind -%}
{{build_call(obj, operation, 'AssociatedInterfaceRequest', name, '"' ~ kind.kind.module.namespace ~ '.' ~ kind.kind.name ~ '"', kind.is_nullable|to_js_boolean)}}
{%- elif kind|is_associated_interface_kind -%}
{%- elif kind|is_associated_interface_kind or kind|is_pending_associated_remote_kind -%}
{{build_call(obj, operation, 'AssociatedInterface', name, '"' ~ kind.kind.module.namespace ~ '.' ~ kind.kind.name ~ '"', kind.is_nullable|to_js_boolean)}}
{%- endif -%}
{%- endmacro -%}
......
......@@ -29,11 +29,13 @@ err = messageValidator.validateInterface({{offset}}, {{field|validate_nullable_p
// validate {{name}}
err = messageValidator.validateInterfaceRequest({{offset}}, {{field|validate_nullable_params}})
{{_check_err()}}
{%- elif field.kind|is_associated_interface_kind %}
{%- elif field.kind|is_associated_interface_kind or
field.kind|is_pending_associated_remote_kind %}
// validate {{name}}
err = messageValidator.validateAssociatedInterface({{offset}}, {{field|validate_nullable_params}});
{{_check_err()}}
{%- elif field.kind|is_associated_interface_request_kind %}
{%- elif field.kind|is_associated_interface_request_kind or
field.kind|is_pending_associated_receiver_kind %}
// validate {{name}}
err = messageValidator.validateAssociatedInterfaceRequest({{offset}}, {{field|validate_nullable_params}})
{{_check_err()}}
......
......@@ -286,8 +286,11 @@ class Generator(generator.Generator):
"is_any_handle_or_interface_kind": mojom.IsAnyHandleOrInterfaceKind,
"is_array_kind": mojom.IsArrayKind,
"is_associated_interface_kind": mojom.IsAssociatedInterfaceKind,
"is_pending_associated_remote_kind": mojom.IsPendingAssociatedRemoteKind,
"is_associated_interface_request_kind":
mojom.IsAssociatedInterfaceRequestKind,
"is_pending_associated_receiver_kind":
mojom.IsPendingAssociatedReceiverKind,
"is_bool_kind": mojom.IsBoolKind,
"is_enum_kind": mojom.IsEnumKind,
"is_any_handle_kind": mojom.IsAnyHandleKind,
......@@ -447,7 +450,9 @@ class Generator(generator.Generator):
self._LiteClosureTypeWithNullability(kind.value_kind))
if (mojom.IsAssociatedKind(kind) or mojom.IsInterfaceRequestKind(kind) or
mojom.IsPendingRemoteKind(kind) or mojom.IsPendingReceiverKind(kind)):
mojom.IsPendingRemoteKind(kind) or mojom.IsPendingReceiverKind(kind) or
mojom.IsPendingAssociatedRemoteKind(kind) or
mojom.IsPendingAssociatedReceiverKind(kind)):
named_kind = kind.kind
else:
named_kind = kind
......@@ -546,7 +551,9 @@ class Generator(generator.Generator):
"true" if mojom.IsNullableKind(kind.value_kind) else "false")
if (mojom.IsAssociatedKind(kind) or mojom.IsInterfaceRequestKind(kind) or
mojom.IsPendingRemoteKind(kind) or mojom.IsPendingReceiverKind(kind)):
mojom.IsPendingRemoteKind(kind) or mojom.IsPendingReceiverKind(kind) or
mojom.IsPendingAssociatedRemoteKind(kind) or
mojom.IsPendingAssociatedReceiverKind(kind)):
named_kind = kind.kind
else:
named_kind = kind
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment