// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module blink.mojom;
import "mojo/public/mojom/base/unguessable_token.mojom";
// Various token types. These are used as cross-layer and cross-process
// identifiers for objects that exist in blink, but which have representations
// in the browser process. They should not be used to identify objects in
// browser-to-renderer control messages; rather, such messages should exist as
// methods on the interface bound to the object itself. They are fine to use
// for informational messages that cross over other interfaces, in both
// directions.
//
// See third_party/blink/public/common/tokens/tokens.h for more details.
////////////////////////////////////////////////////////////////////////////////
// DOCUMENT TOKENS
struct DocumentToken {
mojo_base.mojom.UnguessableToken value;
};
////////////////////////////////////////////////////////////////////////////////
// FRAME TOKENS
struct LocalFrameToken {
mojo_base.mojom.UnguessableToken value;
};
struct RemoteFrameToken {
mojo_base.mojom.UnguessableToken value;
};
union FrameToken {
LocalFrameToken local_frame_token;
RemoteFrameToken remote_frame_token;
};
////////////////////////////////////////////////////////////////////////////////
// WORKER TOKENS
struct DedicatedWorkerToken {
mojo_base.mojom.UnguessableToken value;
};
struct ServiceWorkerToken {
mojo_base.mojom.UnguessableToken value;
};
struct SharedWorkerToken {
mojo_base.mojom.UnguessableToken value;
};
union WorkerToken {
DedicatedWorkerToken dedicated_worker_token;
ServiceWorkerToken service_worker_token;
SharedWorkerToken shared_worker_token;
};
////////////////////////////////////////////////////////////////////////////////
// WORKLET TOKENS
struct AnimationWorkletToken {
mojo_base.mojom.UnguessableToken value;
};
struct AudioWorkletToken {
mojo_base.mojom.UnguessableToken value;
};
struct LayoutWorkletToken {
mojo_base.mojom.UnguessableToken value;
};
struct PaintWorkletToken {
mojo_base.mojom.UnguessableToken value;
};
struct SharedStorageWorkletToken {
mojo_base.mojom.UnguessableToken value;
};
union WorkletToken {
AnimationWorkletToken animation_worklet_token;
AudioWorkletToken audio_worklet_token;
LayoutWorkletToken layout_worklet_token;
PaintWorkletToken paint_worklet_token;
SharedStorageWorkletToken shared_storage_worklet_token;
};
////////////////////////////////////////////////////////////////////////////////
// SHADOW REALM TOKENS
struct ShadowRealmToken {
mojo_base.mojom.UnguessableToken value;
};
////////////////////////////////////////////////////////////////////////////////
// OTHER TOKENS
//
// Keep this section last.
//
// If you have multiple tokens that make a thematic group, please lift them to
// their own section, in alphabetical order. If adding a new token here, please
// keep the following list in alphabetic order.
struct AttributionSrcToken {
mojo_base.mojom.UnguessableToken value;
};
struct ClipboardSequenceNumberToken {
mojo_base.mojom.UnguessableToken value;
};
union ExecutionContextToken {
LocalFrameToken local_frame_token;
DedicatedWorkerToken dedicated_worker_token;
ServiceWorkerToken service_worker_token;
SharedWorkerToken shared_worker_token;
AnimationWorkletToken animation_worklet_token;
AudioWorkletToken audio_worklet_token;
LayoutWorkletToken layout_worklet_token;
PaintWorkletToken paint_worklet_token;
SharedStorageWorkletToken shared_storage_worklet_token;
ShadowRealmToken shadow_realm_token;
};
struct SameDocNavigationScreenshotDestinationToken {
mojo_base.mojom.UnguessableToken value;
};
struct V8ContextToken {
mojo_base.mojom.UnguessableToken value;
};
struct ViewTransitionToken {
mojo_base.mojom.UnguessableToken value;
};
union WebGPUExecutionContextToken {
DocumentToken document_token;
DedicatedWorkerToken dedicated_worker_token;
SharedWorkerToken shared_worker_token;
ServiceWorkerToken service_worker_token;
};
struct WebNNContextToken {
mojo_base.mojom.UnguessableToken value;
};
struct WebNNBufferToken {
mojo_base.mojom.UnguessableToken value;
};