blob: f660019a1f9f197f8a04e690494880c97f956ee5 [file] [log] [blame]
// 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 "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/user_activation_snapshot.mojom";
import "skia/public/interfaces/bitmap.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<handle<message_pipe>> ports;
// 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.Bitmap> image_bitmap_contents_array;
// Whether the recipient should have a user gesture when it processes this
// message.
bool has_user_gesture;
// The user activation state, null if the frame isn't providing it.
UserActivationSnapshot? user_activation;
};