| Index: components/precache/core/precache_fetcher.cc
|
| diff --git a/components/precache/core/precache_fetcher.cc b/components/precache/core/precache_fetcher.cc
|
| index 90d05bb776b6eb6b841c69369f29a3acc5846c87..f1c53c6d450f4df2e85ec59c6c2bc94b3c924a4f 100644
|
| --- a/components/precache/core/precache_fetcher.cc
|
| +++ b/components/precache/core/precache_fetcher.cc
|
| @@ -267,17 +267,20 @@ void PrecacheFetcher::Fetcher::LoadFromNetwork() {
|
| void PrecacheFetcher::Fetcher::OnURLFetchDownloadProgress(
|
| const net::URLFetcher* source,
|
| int64_t current,
|
| - int64_t total) {
|
| - // If going over the per-resource download cap.
|
| + int64_t total,
|
| + int64_t current_network_bytes) {
|
| + // If network bytes going over the per-resource download cap.
|
| if (fetch_stage_ == FetchStage::NETWORK &&
|
| - // |current| is guaranteed to be non-negative, so this cast is safe.
|
| - static_cast<size_t>(std::max(current, total)) > max_bytes_) {
|
| + // |current_network_bytes| is guaranteed to be non-negative, so this cast
|
| + // is safe.
|
| + static_cast<size_t>(current_network_bytes) > max_bytes_) {
|
| VLOG(1) << "Cancelling " << url_ << ": (" << current << "/" << total
|
| << ") is over " << max_bytes_;
|
|
|
| // Call the completion callback, to attempt the next download, or to trigger
|
| // cleanup in precache_delegate_->OnDone().
|
| - response_bytes_ = network_response_bytes_ = current;
|
| + response_bytes_ = current;
|
| + network_response_bytes_ = current_network_bytes;
|
| was_cached_ = source->WasCached();
|
|
|
| // Cancel the download.
|
|
|