#include "components/media_router/common/providers/cast/channel/cast_transport.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include "base/format_macros.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "components/media_router/common/providers/cast/channel/cast_framer.h"
#include "components/media_router/common/providers/cast/channel/cast_message_util.h"
#include "components/media_router/common/providers/cast/channel/logger.h"
#include "net/base/net_errors.h"
#include "third_party/openscreen/src/cast/common/channel/proto/cast_channel.pb.h"
#define VLOG_WITH_CONNECTION(level) …
namespace cast_channel {
namespace {
#if DCHECK_IS_ON()
bool IsPingPong(const CastMessage& message) { … }
#endif
}
CastTransportImpl::CastTransportImpl(Channel* channel,
int channel_id,
const net::IPEndPoint& ip_endpoint,
scoped_refptr<Logger> logger)
: … { … }
CastTransportImpl::~CastTransportImpl() { … }
bool CastTransportImpl::IsTerminalWriteState(WriteState write_state) { … }
bool CastTransportImpl::IsTerminalReadState(ReadState read_state) { … }
void CastTransportImpl::SetReadDelegate(std::unique_ptr<Delegate> delegate) { … }
void CastTransportImpl::FlushWriteQueue() { … }
void CastTransportImpl::SendMessage(const CastMessage& message,
net::CompletionOnceCallback callback) { … }
CastTransportImpl::WriteRequest::WriteRequest(
const std::string& namespace_,
const std::string& payload,
net::CompletionOnceCallback callback)
: … { … }
CastTransportImpl::WriteRequest::WriteRequest(WriteRequest&& other) = default;
CastTransportImpl::WriteRequest::~WriteRequest() { … }
void CastTransportImpl::SetReadState(ReadState read_state) { … }
void CastTransportImpl::SetWriteState(WriteState write_state) { … }
void CastTransportImpl::SetErrorState(ChannelError error_state) { … }
void CastTransportImpl::OnWriteResult(int result) { … }
int CastTransportImpl::DoWrite() { … }
int CastTransportImpl::DoWriteComplete(int result) { … }
int CastTransportImpl::DoWriteCallback() { … }
int CastTransportImpl::DoWriteHandleError(int result) { … }
void CastTransportImpl::Start() { … }
void CastTransportImpl::OnReadResult(int result) { … }
int CastTransportImpl::DoRead() { … }
int CastTransportImpl::DoReadComplete(int result) { … }
int CastTransportImpl::DoReadCallback() { … }
int CastTransportImpl::DoReadHandleError(int result) { … }
}