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

Side by Side Diff: content/public/browser/download_item.h

Issue 2742093002: Glue parallel download job and download file together. (Closed)
Patch Set: Work on feedback. 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
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 // 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
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 using ReceivedSlices = std::vector<DownloadItem::ReceivedSlice>;
David Trainor- moved to gerrit 2017/03/14 17:59:10 Aha!
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698