#include "chrome/browser/media/router/providers/cast/cast_session_tracker.h"
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/media/router/providers/cast/chrome_cast_message_handler.h"
#include "chrome/browser/media/router/providers/cast/dual_media_sink_service.h"
#include "components/media_router/common/providers/cast/channel/cast_socket_service.h"
namespace media_router {
CastSessionTracker::Observer::~Observer() = default;
CastSessionTracker::~CastSessionTracker() { … }
CastSessionTracker* CastSessionTracker::GetInstance() { … }
void CastSessionTracker::AddObserver(CastSessionTracker::Observer* observer) { … }
void CastSessionTracker::RemoveObserver(
CastSessionTracker::Observer* observer) { … }
const CastSessionTracker::SessionMap& CastSessionTracker::GetSessions() const { … }
CastSession* CastSessionTracker::GetSessionById(
const std::string& session_id) const { … }
CastSessionTracker::CastSessionTracker(
MediaSinkServiceBase* media_sink_service,
cast_channel::CastMessageHandler* message_handler,
const scoped_refptr<base::SequencedTaskRunner>& task_runner)
: … { … }
void CastSessionTracker::InitOnIoThread() { … }
void CastSessionTracker::HandleReceiverStatusMessage(
const MediaSinkInternal& sink,
const base::Value::Dict& message) { … }
void CastSessionTracker::HandleMediaStatusMessage(
const MediaSinkInternal& sink,
const base::Value::Dict& message) { … }
void CastSessionTracker::CopySavedMediaFieldsToMediaList(
CastSession* session,
base::Value::List& media_list) { … }
const MediaSinkInternal* CastSessionTracker::GetSinkByChannelId(
int channel_id) const { … }
void CastSessionTracker::OnSinkAddedOrUpdated(const MediaSinkInternal& sink) { … }
void CastSessionTracker::OnSinkRemoved(const MediaSinkInternal& sink) { … }
void CastSessionTracker::OnAppMessage(int channel_id,
const CastMessage& message) { … }
void CastSessionTracker::OnInternalMessage(
int channel_id,
const cast_channel::InternalMessage& message) { … }
void CastSessionTracker::SetInstanceForTest(
CastSessionTracker* session_tracker) { … }
void CastSessionTracker::SetSessionForTest(
const MediaSink::Id& sink_id,
std::unique_ptr<CastSession> session) { … }
CastSessionTracker* CastSessionTracker::instance_for_test_ = …;
}