#include "remoting/host/setup/cloud_host_starter.h"
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "remoting/base/cloud_service_client.h"
#include "remoting/base/protobuf_http_status.h"
#include "remoting/host/setup/host_starter.h"
#include "remoting/host/setup/host_starter_base.h"
#include "remoting/proto/google/internal/remoting/cloud/v1alpha/remote_access_service.pb.h"
#include "remoting/proto/remoting/v1/cloud_messages.pb.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace remoting {
namespace {
LegacyProvisionGceInstanceResponse;
ProvisionGceInstanceResponse;
class CloudHostStarter : public HostStarterBase { … };
CloudHostStarter::CloudHostStarter(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
CloudHostStarter::~CloudHostStarter() = default;
void CloudHostStarter::RegisterNewHost(
const std::string& public_key,
std::optional<std::string> access_token) { … }
void CloudHostStarter::OnProvisionGceInstanceResponse(
const ProtobufHttpStatus& status,
std::unique_ptr<ProvisionGceInstanceResponse> response) { … }
void CloudHostStarter::OnLegacyProvisionGceInstanceResponse(
const ProtobufHttpStatus& status,
std::unique_ptr<LegacyProvisionGceInstanceResponse> response) { … }
void CloudHostStarter::RemoveOldHostFromDirectory(
base::OnceClosure on_host_removed) { … }
}
std::unique_ptr<HostStarter> ProvisionCloudInstance(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) { … }
}