#include "components/download/internal/common/parallel_download_utils.h"
#include "base/metrics/field_trial_params.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "components/download/public/common/download_features.h"
#include "components/download/public/common/download_save_info.h"
#include "components/download/public/common/parallel_download_configs.h"
namespace download {
namespace {
const int64_t kMinSliceSizeParallelDownload = …;
const int kParallelRequestCount = …;
const int kDefaultRemainingTimeInSeconds = …;
bool compareReceivedSlices(const DownloadItem::ReceivedSlice& lhs,
const DownloadItem::ReceivedSlice& rhs) { … }
}
std::vector<DownloadItem::ReceivedSlice> FindSlicesToDownload(
const std::vector<DownloadItem::ReceivedSlice>& received_slices) { … }
size_t AddOrMergeReceivedSliceIntoSortedArray(
const DownloadItem::ReceivedSlice& new_slice,
std::vector<DownloadItem::ReceivedSlice>& received_slices) { … }
bool CanRecoverFromError(
const DownloadFileImpl::SourceStream* error_stream,
const DownloadFileImpl::SourceStream* preceding_neighbor) { … }
void DebugSlicesInfo(const DownloadItem::ReceivedSlices& slices) { … }
std::vector<DownloadItem::ReceivedSlice> FindSlicesForRemainingContent(
int64_t current_offset,
int64_t total_length,
int request_count,
int64_t min_slice_size) { … }
int64_t GetMinSliceSizeConfig() { … }
int GetParallelRequestCountConfig() { … }
base::TimeDelta GetParallelRequestDelayConfig() { … }
base::TimeDelta GetParallelRequestRemainingTimeConfig() { … }
int64_t GetMaxContiguousDataBlockSizeFromBeginning(
const DownloadItem::ReceivedSlices& slices) { … }
bool IsParallelDownloadEnabled() { … }
}