#include "content/browser/websockets/websocket_connector_impl.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "net/storage_access_api/status.h"
#include "services/network/public/cpp/features.h"
#include "url/gurl.h"
namespace content {
namespace {
url::Origin MaybeTreatLocalOriginAsOpaque(const url::Origin& origin) { … }
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = …;
}
WebSocketConnectorImpl::WebSocketConnectorImpl(
int process_id,
int frame_id,
const url::Origin& origin,
const net::IsolationInfo& isolation_info)
: … { … }
WebSocketConnectorImpl::~WebSocketConnectorImpl() = default;
void WebSocketConnectorImpl::Connect(
const GURL& url,
const std::vector<std::string>& requested_protocols,
const net::SiteForCookies& site_for_cookies,
const std::optional<std::string>& user_agent,
net::StorageAccessApiStatus storage_access_api_status,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client,
const std::optional<base::UnguessableToken>& throttling_profile_id) { … }
void WebSocketConnectorImpl::ConnectCalledByContentBrowserClient(
const std::vector<std::string>& requested_protocols,
const net::SiteForCookies& site_for_cookies,
net::StorageAccessApiStatus storage_access_api_status,
const net::IsolationInfo& isolation_info,
int process_id,
int frame_id,
const url::Origin& origin,
uint32_t options,
std::optional<base::UnguessableToken> throttling_profile_id,
const GURL& url,
std::vector<network::mojom::HttpHeaderPtr> additional_headers,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client,
mojo::PendingRemote<network::mojom::WebSocketAuthenticationHandler>
auth_handler,
mojo::PendingRemote<network::mojom::TrustedHeaderClient>
trusted_header_client) { … }
}