blob: b569ea7ce59f0b54d2863aa4b1c466087a315546 [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/WebKit/common/blob/serialized_blob.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 represents the cloneable part of messages that are sent across
// postMessage style APIs. In particular this is used for BroadcastChannel.
struct CloneableMessage {
array<uint8> encoded_message;
// Blob handles for any blobs being sent in this message.
array<SerializedBlob> blobs;
// Stack trace captured by sender.
// For more details see v8_inspector::V8StackTraceId.
// TODO(kozyatinskiy): move this to separate headers as soon as we get
// separate inspector folder.
uint64 stack_trace_id;
int64 stack_trace_debugger_id_first;
int64 stack_trace_debugger_id_second;
};
// 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 transfered. This struct is used for most postMessage style APIs,
// including messages posted on MessagePorts themselves.
struct TransferableMessage {
CloneableMessage message;
// Any ports being transfered as part of this message.
array<handle<message_pipe>> ports;
};