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

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

Issue 2799333002: Clear the received slices in DownloadItemImpl when etag changed. (Closed)
Patch Set: Address the uma issue. 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 unified diff | Download patch
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 29 matching lines...) Expand all
40 // May be constructed on any thread. All methods besides the constructor 40 // May be constructed on any thread. All methods besides the constructor
41 // (including destruction) must occur on the FILE thread. 41 // (including destruction) must occur on the FILE thread.
42 // 42 //
43 // Note that the DownloadFileImpl automatically reads from the passed in 43 // Note that the DownloadFileImpl automatically reads from the passed in
44 // stream, and sends updates and status of those reads to the 44 // stream, and sends updates and status of those reads to the
45 // DownloadDestinationObserver. 45 // DownloadDestinationObserver.
46 DownloadFileImpl( 46 DownloadFileImpl(
47 std::unique_ptr<DownloadSaveInfo> save_info, 47 std::unique_ptr<DownloadSaveInfo> save_info,
48 const base::FilePath& default_downloads_directory, 48 const base::FilePath& default_downloads_directory,
49 std::unique_ptr<ByteStreamReader> stream_reader, 49 std::unique_ptr<ByteStreamReader> stream_reader,
50 const std::vector<DownloadItem::ReceivedSlice>& received_slices,
51 const net::NetLogWithSource& net_log, 50 const net::NetLogWithSource& net_log,
52 base::WeakPtr<DownloadDestinationObserver> observer); 51 base::WeakPtr<DownloadDestinationObserver> observer);
53 52
54 ~DownloadFileImpl() override; 53 ~DownloadFileImpl() override;
55 54
56 // DownloadFile functions. 55 // DownloadFile functions.
57 void Initialize(const InitializeCallback& callback) override; 56 void Initialize(const InitializeCallback& callback,
57 const DownloadItem::ReceivedSlices& received_slices) override;
58 58
59 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, 59 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
60 int64_t offset, 60 int64_t offset,
61 int64_t length) override; 61 int64_t length) override;
62 62
63 void RenameAndUniquify(const base::FilePath& full_path, 63 void RenameAndUniquify(const base::FilePath& full_path,
64 const RenameCompletionCallback& callback) override; 64 const RenameCompletionCallback& callback) override;
65 void RenameAndAnnotate(const base::FilePath& full_path, 65 void RenameAndAnnotate(const base::FilePath& full_path,
66 const std::string& client_guid, 66 const std::string& client_guid,
67 const GURL& source_url, 67 const GURL& source_url,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 base::WeakPtr<DownloadDestinationObserver> observer_; 274 base::WeakPtr<DownloadDestinationObserver> observer_;
275 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; 275 base::WeakPtrFactory<DownloadFileImpl> weak_factory_;
276 276
277 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); 277 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl);
278 }; 278 };
279 279
280 } // namespace content 280 } // namespace content
281 281
282 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 282 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_file_factory.cc ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698