#include "content/browser/webtransport/web_transport_connector_impl.h"
#include "base/strings/stringprintf.h"
#include "content/browser/devtools/devtools_instrumentation.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/webtransport/web_transport_throttle_context.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace content {
namespace {
WebTransportHandshakeClient;
const void* const kWebTransportThrottleContextKey = …;
base::WeakPtr<WebTransportThrottleContext> GetThrottleContextFromUserData(
base::SupportsUserData* context_holder) { … }
base::WeakPtr<WebTransportThrottleContext> GetThrottleContext(
int process_id,
base::WeakPtr<RenderFrameHostImpl> frame) { … }
class InterceptingHandshakeClient final : public WebTransportHandshakeClient { … };
}
WebTransportConnectorImpl::WebTransportConnectorImpl(
int process_id,
base::WeakPtr<RenderFrameHostImpl> frame,
const url::Origin& origin,
const net::NetworkAnonymizationKey& network_anonymization_key)
: … { … }
WebTransportConnectorImpl::~WebTransportConnectorImpl() = default;
void WebTransportConnectorImpl::Connect(
const GURL& url,
std::vector<network::mojom::WebTransportCertificateFingerprintPtr>
fingerprints,
mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
handshake_client) { … }
void WebTransportConnectorImpl::OnThrottleDone(
const GURL& url,
std::vector<network::mojom::WebTransportCertificateFingerprintPtr>
fingerprints,
mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
handshake_client,
std::unique_ptr<WebTransportThrottleContext::Tracker> tracker) { … }
void WebTransportConnectorImpl::OnWillCreateWebTransportCompleted(
const GURL& url,
std::vector<network::mojom::WebTransportCertificateFingerprintPtr>
fingerprints,
mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
handshake_client,
std::optional<network::mojom::WebTransportErrorPtr> error) { … }
}