#include "device/fido/cable/websocket_adapter.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "components/device_event_log/device_event_log.h"
#include "device/fido/fido_constants.h"
#include "net/http/http_status_code.h"
namespace device {
namespace cablev2 {
static constexpr size_t kMaxIncomingMessageSize = …;
WebSocketAdapter::WebSocketAdapter(TunnelReadyCallback on_tunnel_ready,
TunnelDataCallback on_tunnel_data)
: … { … }
WebSocketAdapter::~WebSocketAdapter() = default;
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
WebSocketAdapter::BindNewHandshakeClientPipe() { … }
bool WebSocketAdapter::Write(base::span<const uint8_t> data) { … }
void WebSocketAdapter::Reparent(TunnelDataCallback on_tunnel_data) { … }
void WebSocketAdapter::OnOpeningHandshakeStarted(
network::mojom::WebSocketHandshakeRequestPtr request) { … }
void WebSocketAdapter::OnFailure(const std::string& message,
int net_error,
int response_code) { … }
void WebSocketAdapter::OnConnectionEstablished(
mojo::PendingRemote<network::mojom::WebSocket> socket,
mojo::PendingReceiver<network::mojom::WebSocketClient> client_receiver,
network::mojom::WebSocketHandshakeResponsePtr response,
mojo::ScopedDataPipeConsumerHandle readable,
mojo::ScopedDataPipeProducerHandle writable) { … }
void WebSocketAdapter::OnDataFrame(bool finish,
network::mojom::WebSocketMessageType type,
uint64_t data_len) { … }
void WebSocketAdapter::OnDropChannel(bool was_clean,
uint16_t code,
const std::string& reason) { … }
void WebSocketAdapter::OnClosingHandshake() { … }
void WebSocketAdapter::OnDataPipeReady(MojoResult,
const mojo::HandleSignalsState&) { … }
void WebSocketAdapter::OnMojoPipeDisconnect() { … }
void WebSocketAdapter::Close() { … }
void WebSocketAdapter::FlushPendingMessage() { … }
}
}