Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: content/browser/download/download_file_impl.cc

Issue 2829853011: Polish the cleaning up url request code for parallel download. (Closed)
Patch Set: Work on feedbacks. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_impl.cc
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index dd2cb8578dd13fa15b00e9327421e4082dc2395b..b17e42bbd73d3651a07015bf8c7b39bc1d078fcb 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -476,7 +476,7 @@ void DownloadFileImpl::StreamActive(SourceStream* source_stream) {
source_stream->stream_reader()->RegisterCallback(base::Closure());
source_stream->set_finished(true);
if (should_terminate)
- CancelRequestOnUIThread(source_stream->offset());
+ CancelRequest(source_stream->offset());
if (source_stream->length() == DownloadSaveInfo::kLengthFullContent) {
SetPotentialFileLength(source_stream->offset() +
source_stream->bytes_written());
@@ -650,7 +650,7 @@ void DownloadFileImpl::HandleStreamError(SourceStream* source_stream,
DCHECK_EQ(stream.second->bytes_written(), 0);
stream.second->stream_reader()->RegisterCallback(base::Closure());
stream.second->set_finished(true);
- CancelRequestOnUIThread(stream.second->offset());
+ CancelRequest(stream.second->offset());
num_active_streams_--;
}
}
@@ -690,7 +690,7 @@ DownloadFileImpl::SourceStream* DownloadFileImpl::FindPrecedingNeighbor(
return ret;
}
-void DownloadFileImpl::CancelRequestOnUIThread(int64_t offset) {
+void DownloadFileImpl::CancelRequest(int64_t offset) {
if (!cancel_request_callback_.is_null()) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(cancel_request_callback_, offset));
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698