#include "chrome/browser/media/router/providers/cast/cast_session_client_impl.h"
#include <vector>
#include "chrome/browser/media/router/data_decoder_util.h"
#include "chrome/browser/media/router/providers/cast/app_activity.h"
#include "components/media_router/common/providers/cast/channel/enum_table.h"
PresentationConnectionCloseReason;
PresentationConnectionMessagePtr;
PresentationConnectionState;
namespace media_router {
namespace {
void ReportClientMessageParseError(const MediaRoute::Id& route_id,
const std::string& error) { … }
void RemoveNullFields(base::Value& value) { … }
}
CastSessionClientImpl::CastSessionClientImpl(const std::string& client_id,
const url::Origin& origin,
int frame_tree_node_id,
AutoJoinPolicy auto_join_policy,
CastActivity* activity)
: … { … }
CastSessionClientImpl::~CastSessionClientImpl() = default;
mojom::RoutePresentationConnectionPtr CastSessionClientImpl::Init() { … }
void CastSessionClientImpl::SendMessageToClient(
PresentationConnectionMessagePtr message) { … }
void CastSessionClientImpl::SendMediaMessageToClient(
const base::Value::Dict& payload,
std::optional<int> request_id) { … }
bool CastSessionClientImpl::MatchesAutoJoinPolicy(
url::Origin other_origin,
int other_frame_tree_node_id) const { … }
void CastSessionClientImpl::OnMessage(
PresentationConnectionMessagePtr message) { … }
void CastSessionClientImpl::DidClose(PresentationConnectionCloseReason reason) { … }
void CastSessionClientImpl::SendErrorCodeToClient(
int sequence_number,
CastInternalMessage::ErrorCode error_code,
std::optional<std::string> description) { … }
void CastSessionClientImpl::SendErrorToClient(int sequence_number,
base::Value::Dict error) { … }
void CastSessionClientImpl::HandleParsedClientMessage(
data_decoder::DataDecoder::ValueOrError result) { … }
void CastSessionClientImpl::HandleV2ProtocolMessage(
const CastInternalMessage& cast_message) { … }
void CastSessionClientImpl::SendResultResponse(int sequence_number,
cast_channel::Result result) { … }
void CastSessionClientImpl::CloseConnection(
PresentationConnectionCloseReason close_reason) { … }
void CastSessionClientImpl::TerminateConnection() { … }
void CastSessionClientImpl::TearDownPresentationConnection() { … }
cast_channel::ResultCallback CastSessionClientImpl::MakeResultCallback(
const CastInternalMessage& cast_message) { … }
}