Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 std::unique_ptr<crypto::SecureHash> hash_state); | 226 std::unique_ptr<crypto::SecureHash> hash_state); |
| 227 | 227 |
| 228 // Called by SavePackage to display progress when the DownloadItem | 228 // Called by SavePackage to display progress when the DownloadItem |
| 229 // should be considered complete. | 229 // should be considered complete. |
| 230 virtual void MarkAsComplete(); | 230 virtual void MarkAsComplete(); |
| 231 | 231 |
| 232 // DownloadDestinationObserver | 232 // DownloadDestinationObserver |
| 233 void DestinationUpdate( | 233 void DestinationUpdate( |
| 234 int64_t bytes_so_far, | 234 int64_t bytes_so_far, |
| 235 int64_t bytes_per_sec, | 235 int64_t bytes_per_sec, |
| 236 const std::vector<DownloadItem::ReceivedSlice>& received_slices) override; | 236 const std::vector<DownloadItem::ReceivedSlice>& received_slices, |
| 237 const std::unordered_set<int64_t>& stream_to_close) override; | |
|
qinmin
2017/04/14 20:04:43
I would use finished_stream_offsets instead of str
xingliu
2017/04/15 00:26:29
Done, changed to use a callback.
Callback looks c
| |
| 237 void DestinationError( | 238 void DestinationError( |
| 238 DownloadInterruptReason reason, | 239 DownloadInterruptReason reason, |
| 239 int64_t bytes_so_far, | 240 int64_t bytes_so_far, |
| 240 std::unique_ptr<crypto::SecureHash> hash_state) override; | 241 std::unique_ptr<crypto::SecureHash> hash_state) override; |
| 241 void DestinationCompleted( | 242 void DestinationCompleted( |
| 242 int64_t total_bytes, | 243 int64_t total_bytes, |
| 243 std::unique_ptr<crypto::SecureHash> hash_state) override; | 244 std::unique_ptr<crypto::SecureHash> hash_state) override; |
| 244 | 245 |
| 245 private: | 246 private: |
| 246 friend class DownloadJob; | 247 friend class DownloadJob; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 std::unique_ptr<DownloadJob> job_; | 712 std::unique_ptr<DownloadJob> job_; |
| 712 | 713 |
| 713 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 714 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| 714 | 715 |
| 715 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 716 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
| 716 }; | 717 }; |
| 717 | 718 |
| 718 } // namespace content | 719 } // namespace content |
| 719 | 720 |
| 720 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 721 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| OLD | NEW |