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

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

Issue 2734493003: Pass slice info to DownloadFileImpl (Closed)
Patch Set: rebase Created 3 years, 9 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 de810fed95897b341fd4743dc3c06663e33c3d31..869c4e08f95663425c5dd5d37e1fc54c0c556ce3 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -59,6 +59,7 @@ DownloadFileImpl::DownloadFileImpl(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream_reader,
+ const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& download_item_net_log,
bool is_sparse_file,
base::WeakPtr<DownloadDestinationObserver> observer)
@@ -70,6 +71,7 @@ DownloadFileImpl::DownloadFileImpl(
default_download_directory_(default_download_directory),
is_sparse_file_(is_sparse_file),
bytes_seen_(0),
+ received_slices_(received_slices),
observer_(observer),
weak_factory_(this) {
source_streams_[save_info_->offset] = base::MakeUnique<SourceStream>(
@@ -411,12 +413,13 @@ int64_t DownloadFileImpl::TotalBytesReceived() const {
}
void DownloadFileImpl::SendUpdate() {
- // TODO(xingliu): Update slice info to observer to update history db.
+ // TODO(qinmin): For each active stream, add the slice it has written so
+ // far along with received_slices_.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&DownloadDestinationObserver::DestinationUpdate, observer_,
TotalBytesReceived(), rate_estimator_.GetCountPerSecond(),
- std::vector<DownloadItem::ReceivedSlice>()));
+ received_slices_));
}
void DownloadFileImpl::WillWriteToDisk(size_t data_len) {
« 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