chromium/third_party/blink/public/mojom/websockets/websocket_connector.mojom

// Copyright 2019 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";
import "services/network/public/mojom/site_for_cookies.mojom";
import "services/network/public/mojom/storage_access_api.mojom";
import "services/network/public/mojom/websocket.mojom";
import "url/mojom/url.mojom";

// An interface for creating a WebSocket connection from the renderer,
// implemented in the browser process.
interface WebSocketConnector {
  // Starts an opening handshake.
  // |storage_access_api_status| is used to opt into using a "storage-access"
  // permission grant. |user_agent| is a "user-agent" request header value. For
  // other params, see CreateWebSocket in
  // //services/network/public/mojom/network_context.mojom.  It is recommended
  // to detect mojo connection errors on |handshake_client| until the connection
  // is established. See network_context.mojom for details.
  Connect(url.mojom.Url url,
          array<string> requested_protocols,
          network.mojom.SiteForCookies site_for_cookies,
          string? user_agent,
          network.mojom.StorageAccessApiStatus storage_access_api_status,
          pending_remote<network.mojom.WebSocketHandshakeClient> handshake_client,
          mojo_base.mojom.UnguessableToken? throttling_profile_id);

};