| // Copyright 2017 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module blink.mojom; |
| |
| import "skia/public/mojom/bitmap.mojom"; |
| import "third_party/blink/public/mojom/array_buffer/array_buffer_contents.mojom"; |
| import "third_party/blink/public/mojom/blob/serialized_blob.mojom"; |
| import "third_party/blink/public/mojom/messaging/cloneable_message.mojom"; |
| import "third_party/blink/public/mojom/messaging/message_port_descriptor.mojom"; |
| import "third_party/blink/public/mojom/messaging/user_activation_snapshot.mojom"; |
| import "third_party/blink/public/mojom/messaging/task_attribution_id.mojom"; |
| |
| // A MessagePort is represented as a raw mojo message pipe, as such no interface |
| // definition exists for it here. Messages on this pipe are serialized versions |
| // of the TransferableMessage struct defined below. |
| // TODO(crbug.com/750468): Consider using an actual Mojo interface for message |
| // ports. |
| |
| // This struct combines the cloneable part of a message with the parts of the |
| // message that are merely transferable. In particular that includes ports that |
| // are transferred. This struct is used for most postMessage style APIs, |
| // including messages posted on MessagePorts themselves. |
| struct TransferableMessage { |
| CloneableMessage message; |
| // Any ports being transferred as part of this message. |
| array<MessagePortDescriptor> ports; |
| // Channels used to transfer WHATWG streams (eg. ReadableStream). |
| array<MessagePortDescriptor> stream_channels; |
| // Any ArrayBuffers being transferred as part of this message. |
| array<SerializedArrayBufferContents> array_buffer_contents_array; |
| // Any ImageBitmaps being transferred as part of this message. |
| array<skia.mojom.BitmapN32> image_bitmap_contents_array; |
| // The user activation state, null if the frame isn't providing it. |
| UserActivationSnapshot? user_activation; |
| // Whether payment request capability is delegated to the destination frame. |
| // |
| // TODO(mustaq): Replace this with a structure for capability-specific bits. |
| bool delegate_payment_request; |
| // The ID of the task initiating the message. |
| TaskAttributionId? parent_task_id; |
| }; |