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

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

Issue 2782033002: remove is_sparse_file_ from DownloadFileImpl (Closed)
Patch Set: add IsSparseFile() helper method 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
Index: content/browser/download/download_file_impl.h
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h
index 7b9ea68bd258a3e03793c1a675d3d99bd22f6876..e786c2b38b0fff0400e9f4d9bed85463b60b22b9 100644
--- a/content/browser/download/download_file_impl.h
+++ b/content/browser/download/download_file_impl.h
@@ -49,7 +49,6 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
std::unique_ptr<ByteStreamReader> stream_reader,
const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
- bool is_sparse_file,
base::WeakPtr<DownloadDestinationObserver> observer);
~DownloadFileImpl() override;
@@ -222,6 +221,9 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
void HandleStreamError(SourceStream* source_stream,
DownloadInterruptReason reason);
+ // Check whether this file is potentially sparse.
+ bool IsSparseFile() const;
+
// Given a SourceStream object, returns its neighbor that preceds it if
// SourceStreams are ordered by their offsets
SourceStream* FindPrecedingNeighbor(SourceStream* source_stream);
@@ -249,12 +251,6 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
// Used to trigger progress updates.
std::unique_ptr<base::RepeatingTimer> update_timer_;
- // Set to true when multiple byte streams write to the same file.
- // The file may contain null bytes(holes) in between of valid data slices.
- // TODO(xingliu): Remove this variable. We can use size of |received_slices_|
- // to determine if the file is sparse
- bool is_sparse_file_;
-
// Statistics
size_t bytes_seen_;
base::TimeDelta disk_writes_time_;

Powered by Google App Engine
This is Rietveld 408576698