#include "components/download/internal/background_service/in_memory_download_driver.h"
#include "base/task/single_thread_task_runner.h"
#include "components/download/internal/background_service/in_memory_download.h"
#include "services/network/public/cpp/resource_request_body.h"
namespace download {
namespace {
DriverEntry::State ToDriverEntryState(InMemoryDownload::State state) { … }
DriverEntry CreateDriverEntry(const InMemoryDownload& download) { … }
}
InMemoryDownloadFactory::InMemoryDownloadFactory(
network::mojom::URLLoaderFactory* url_loader_factory,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: … { … }
InMemoryDownloadFactory::~InMemoryDownloadFactory() = default;
std::unique_ptr<InMemoryDownload> InMemoryDownloadFactory::Create(
const std::string& guid,
const RequestParams& request_params,
scoped_refptr<network::ResourceRequestBody> request_body,
const net::NetworkTrafficAnnotationTag& traffic_annotation,
InMemoryDownload::Delegate* delegate) { … }
InMemoryDownloadDriver::InMemoryDownloadDriver(
std::unique_ptr<InMemoryDownload::Factory> download_factory,
BlobContextGetterFactoryPtr blob_context_getter_factory)
: … { … }
InMemoryDownloadDriver::~InMemoryDownloadDriver() = default;
void InMemoryDownloadDriver::Initialize(DownloadDriver::Client* client) { … }
void InMemoryDownloadDriver::HardRecover() { … }
bool InMemoryDownloadDriver::IsReady() const { … }
void InMemoryDownloadDriver::Start(
const RequestParams& request_params,
const std::string& guid,
const base::FilePath& file_path,
scoped_refptr<network::ResourceRequestBody> request_body,
const net::NetworkTrafficAnnotationTag& traffic_annotation) { … }
void InMemoryDownloadDriver::Remove(const std::string& guid, bool remove_file) { … }
void InMemoryDownloadDriver::Pause(const std::string& guid) { … }
void InMemoryDownloadDriver::Resume(const std::string& guid) { … }
std::optional<DriverEntry> InMemoryDownloadDriver::Find(
const std::string& guid) { … }
std::set<std::string> InMemoryDownloadDriver::GetActiveDownloads() { … }
size_t InMemoryDownloadDriver::EstimateMemoryUsage() const { … }
void InMemoryDownloadDriver::OnDownloadStarted(InMemoryDownload* download) { … }
void InMemoryDownloadDriver::OnDownloadProgress(InMemoryDownload* download) { … }
void InMemoryDownloadDriver::OnDownloadComplete(InMemoryDownload* download) { … }
void InMemoryDownloadDriver::OnUploadProgress(InMemoryDownload* download) { … }
void InMemoryDownloadDriver::RetrieveBlobContextGetter(
BlobContextGetterCallback callback) { … }
}