#ifndef COMPONENTS_CAST_RECEIVER_BROWSER_STREAMING_RUNTIME_APPLICATION_H_
#define COMPONENTS_CAST_RECEIVER_BROWSER_STREAMING_RUNTIME_APPLICATION_H_
#include "base/sequence_checker.h"
#include "components/cast_receiver/browser/public/application_config.h"
#include "components/cast_receiver/browser/runtime_application_base.h"
#include "components/cast_receiver/browser/streaming_receiver_session_client.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/network_context_getter.h"
namespace cast_receiver {
class ApplicationClient;
class MessagePortService;
class StreamingRuntimeApplication final
: public RuntimeApplicationBase,
public StreamingReceiverSessionClient::Handler {
public:
StreamingRuntimeApplication(std::string cast_session_id,
ApplicationConfig app_config,
ApplicationClient& application_client);
~StreamingRuntimeApplication() override;
StreamingRuntimeApplication(StreamingRuntimeApplication& other) = delete;
StreamingRuntimeApplication& operator=(StreamingRuntimeApplication& other) =
delete;
private:
void Launch(StatusCallback callback) override;
void StopApplication(EmbedderApplication::ApplicationStopReason stop_reason,
net::Error net_error_code) override;
bool IsStreamingApplication() const override;
void OnStreamingSessionStarted() override;
void OnError() override;
const network::NetworkContextGetter network_context_getter_;
std::unique_ptr<MessagePortService> message_port_service_;
std::unique_ptr<StreamingReceiverSessionClient> receiver_session_client_;
SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<StreamingRuntimeApplication> weak_factory_{this};
};
}
#endif