chromium/third_party/blink/public/mojom/worker/shared_worker_connector.mojom

// Copyright 2017 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 "third_party/blink/public/mojom/blob/blob_url_store.mojom";
import "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom";
import "third_party/blink/public/mojom/messaging/message_port_descriptor.mojom";
import "third_party/blink/public/mojom/worker/shared_worker_client.mojom";
import "third_party/blink/public/mojom/worker/shared_worker_creation_context_type.mojom";
import "third_party/blink/public/mojom/worker/shared_worker_info.mojom";

// This interface is exposed to enable a client to create and connect to a
// shared worker.
interface SharedWorkerConnector {
  // Connect to (and create if necessary) a SharedWorker specified by |info|.
  // The SharedWorker will be terminated if all clients go away.
  // |blob_url_token| should be non-null when the worker is loaded from a blob:
  // URL. The token will then be used to look up the blob associated with the
  // blob URL. Without this by the time the worker code starts fetching
  // the URL the blob URL might no longer be valid.
  Connect(SharedWorkerInfo info,
          pending_remote<SharedWorkerClient> client,
          SharedWorkerCreationContextType creation_context_type,
          MessagePortDescriptor message_port,
          pending_remote<BlobURLToken>? blob_url_token,
          int64 client_ukm_source_id);
};