#include "components/download/internal/common/parallel_download_job.h"
#include <algorithm>
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/time/time.h"
#include "components/download/internal/common/parallel_download_utils.h"
#include "components/download/public/common/download_create_info.h"
#include "components/download/public/common/download_stats.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/referrer_policy.h"
namespace download {
namespace {
const int kDownloadJobVerboseLevel = …;
}
ParallelDownloadJob::ParallelDownloadJob(
DownloadItem* download_item,
CancelRequestCallback cancel_request_callback,
const DownloadCreateInfo& create_info,
URLLoaderFactoryProvider::URLLoaderFactoryProviderPtr
url_loader_factory_provider,
DownloadJobFactory::WakeLockProviderBinder wake_lock_provider_binder)
: … { … }
ParallelDownloadJob::~ParallelDownloadJob() = default;
void ParallelDownloadJob::OnDownloadFileInitialized(
DownloadFile::InitializeCallback callback,
DownloadInterruptReason result,
int64_t bytes_wasted) { … }
void ParallelDownloadJob::Cancel(bool user_cancel) { … }
void ParallelDownloadJob::Pause() { … }
void ParallelDownloadJob::Resume(bool resume_request) { … }
int ParallelDownloadJob::GetParallelRequestCount() const { … }
int64_t ParallelDownloadJob::GetMinSliceSize() const { … }
int ParallelDownloadJob::GetMinRemainingTimeInSeconds() const { … }
void ParallelDownloadJob::CancelRequestWithOffset(int64_t offset) { … }
void ParallelDownloadJob::BuildParallelRequestAfterDelay() { … }
void ParallelDownloadJob::OnInputStreamReady(
DownloadWorker* worker,
std::unique_ptr<InputStream> input_stream,
std::unique_ptr<DownloadCreateInfo> download_create_info) { … }
void ParallelDownloadJob::BuildParallelRequests() { … }
void ParallelDownloadJob::ForkSubRequests(
const DownloadItem::ReceivedSlices& slices_to_download) { … }
void ParallelDownloadJob::CreateRequest(int64_t offset) { … }
}