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

Side by Side Diff: content/browser/download/download_file_impl.h

Issue 2738063002: Verify that all slice are downloaded when a stream complete (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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
7 7
8 #include "content/browser/download/download_file.h" 8 #include "content/browser/download/download_file.h"
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void StreamActive(SourceStream* source_stream); 188 void StreamActive(SourceStream* source_stream);
189 189
190 // Register callback and start to read data from the stream. 190 // Register callback and start to read data from the stream.
191 void RegisterAndActivateStream(SourceStream* source_stream); 191 void RegisterAndActivateStream(SourceStream* source_stream);
192 192
193 // Adds a new slice to |received_slices_| and update the existing entries in 193 // Adds a new slice to |received_slices_| and update the existing entries in
194 // |source_streams_| as their lengths will change. 194 // |source_streams_| as their lengths will change.
195 // TODO(qinmin): add a test for this function. 195 // TODO(qinmin): add a test for this function.
196 void AddNewSlice(int64_t offset, int64_t length); 196 void AddNewSlice(int64_t offset, int64_t length);
197 197
198 // Check if download is completed.
199 bool IsDownloadCompleted();
200
198 // Return the total valid bytes received in the target file. 201 // Return the total valid bytes received in the target file.
199 // If the file is a sparse file, return the total number of valid bytes. 202 // If the file is a sparse file, return the total number of valid bytes.
200 // Otherwise, return the current file size. 203 // Otherwise, return the current file size.
201 int64_t TotalBytesReceived() const; 204 int64_t TotalBytesReceived() const;
202 205
203 net::NetLogWithSource net_log_; 206 net::NetLogWithSource net_log_;
204 207
205 // The base file instance. 208 // The base file instance.
206 BaseFile file_; 209 BaseFile file_;
207 210
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 244
242 base::WeakPtr<DownloadDestinationObserver> observer_; 245 base::WeakPtr<DownloadDestinationObserver> observer_;
243 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; 246 base::WeakPtrFactory<DownloadFileImpl> weak_factory_;
244 247
245 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); 248 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl);
246 }; 249 };
247 250
248 } // namespace content 251 } // namespace content
249 252
250 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 253 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698