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 // Each download is represented by a DownloadItem, and all DownloadItems | 5 // Each download is represented by a DownloadItem, and all DownloadItems |
| 6 // are owned by the DownloadManager which maintains a global list of all | 6 // are owned by the DownloadManager which maintains a global list of all |
| 7 // downloads. DownloadItems are created when a user initiates a download, | 7 // downloads. DownloadItems are created when a user initiates a download, |
| 8 // and exist for the duration of the browser life time. | 8 // and exist for the duration of the browser life time. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 : offset(offset), received_bytes(received_bytes) {} | 110 : offset(offset), received_bytes(received_bytes) {} |
| 111 | 111 |
| 112 bool operator==(const ReceivedSlice& rhs) const { | 112 bool operator==(const ReceivedSlice& rhs) const { |
| 113 return offset == rhs.offset && received_bytes == rhs.received_bytes; | 113 return offset == rhs.offset && received_bytes == rhs.received_bytes; |
| 114 } | 114 } |
| 115 | 115 |
| 116 int64_t offset; | 116 int64_t offset; |
| 117 int64_t received_bytes; | 117 int64_t received_bytes; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 typedef std::vector<DownloadItem::ReceivedSlice> ReceivedSlices; | |
|
qinmin
2017/03/11 06:08:22
nit: using ReceivedSlices = std::vector<DownloadIt
xingliu
2017/03/13 17:53:17
Done.
| |
| 121 | |
| 120 ~DownloadItem() override {} | 122 ~DownloadItem() override {} |
| 121 | 123 |
| 122 // Observation --------------------------------------------------------------- | 124 // Observation --------------------------------------------------------------- |
| 123 | 125 |
| 124 virtual void AddObserver(DownloadItem::Observer* observer) = 0; | 126 virtual void AddObserver(DownloadItem::Observer* observer) = 0; |
| 125 virtual void RemoveObserver(DownloadItem::Observer* observer) = 0; | 127 virtual void RemoveObserver(DownloadItem::Observer* observer) = 0; |
| 126 virtual void UpdateObservers() = 0; | 128 virtual void UpdateObservers() = 0; |
| 127 | 129 |
| 128 // User Actions -------------------------------------------------------------- | 130 // User Actions -------------------------------------------------------------- |
| 129 | 131 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 // return |name|. Has no effect on the final target filename. | 436 // return |name|. Has no effect on the final target filename. |
| 435 virtual void SetDisplayName(const base::FilePath& name) = 0; | 437 virtual void SetDisplayName(const base::FilePath& name) = 0; |
| 436 | 438 |
| 437 // Debug/testing ------------------------------------------------------------- | 439 // Debug/testing ------------------------------------------------------------- |
| 438 virtual std::string DebugString(bool verbose) const = 0; | 440 virtual std::string DebugString(bool verbose) const = 0; |
| 439 }; | 441 }; |
| 440 | 442 |
| 441 } // namespace content | 443 } // namespace content |
| 442 | 444 |
| 443 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ | 445 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ |
| OLD | NEW |