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

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

Issue 2618743006: Use previous target path when resuming a download after crash (Closed)
Patch Set: adding a helper function to get last used target path Created 3 years, 11 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // Target path of an in-progress download. We may be downloading to a 275 // Target path of an in-progress download. We may be downloading to a
276 // temporary or intermediate file (specified by GetFullPath()); this is the 276 // temporary or intermediate file (specified by GetFullPath()); this is the
277 // name we will use once the download completes. 277 // name we will use once the download completes.
278 // May be empty if the target path hasn't yet been determined. 278 // May be empty if the target path hasn't yet been determined.
279 virtual const base::FilePath& GetTargetFilePath() const = 0; 279 virtual const base::FilePath& GetTargetFilePath() const = 0;
280 280
281 // If the download forced a path rather than requesting name determination, 281 // If the download forced a path rather than requesting name determination,
282 // return the path requested. 282 // return the path requested.
283 virtual const base::FilePath& GetForcedFilePath() const = 0; 283 virtual const base::FilePath& GetForcedFilePath() const = 0;
284 284
285 // Get the target path that was used most recently. It could be either the
286 // forced file path, or the target file path, if any one of them is provided.
287 virtual base::FilePath GetLastUsedTargetPath() const {
asanka 2017/01/10 19:34:19 = 0. But then again we shouldn't have this method
qinmin 2017/01/10 22:06:29 Done.
288 return base::FilePath();
289 }
290
285 // Returns the file-name that should be reported to the user. If a display 291 // Returns the file-name that should be reported to the user. If a display
286 // name has been explicitly set using SetDisplayName(), this function returns 292 // name has been explicitly set using SetDisplayName(), this function returns
287 // that display name. Otherwise returns the final target filename. 293 // that display name. Otherwise returns the final target filename.
288 virtual base::FilePath GetFileNameToReportUser() const = 0; 294 virtual base::FilePath GetFileNameToReportUser() const = 0;
289 295
290 // See TargetDisposition. 296 // See TargetDisposition.
291 virtual TargetDisposition GetTargetDisposition() const = 0; 297 virtual TargetDisposition GetTargetDisposition() const = 0;
292 298
293 // Final hash of completely downloaded file, or partial hash of an interrupted 299 // Final hash of completely downloaded file, or partial hash of an interrupted
294 // download; only valid if GetState() == COMPLETED or INTERRUPTED. If 300 // download; only valid if GetState() == COMPLETED or INTERRUPTED. If
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // return |name|. Has no effect on the final target filename. 414 // return |name|. Has no effect on the final target filename.
409 virtual void SetDisplayName(const base::FilePath& name) = 0; 415 virtual void SetDisplayName(const base::FilePath& name) = 0;
410 416
411 // Debug/testing ------------------------------------------------------------- 417 // Debug/testing -------------------------------------------------------------
412 virtual std::string DebugString(bool verbose) const = 0; 418 virtual std::string DebugString(bool verbose) const = 0;
413 }; 419 };
414 420
415 } // namespace content 421 } // namespace content
416 422
417 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ 423 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698