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

Side by Side Diff: chrome/browser/history/download_row.h

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to r180302 Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/download_database.cc ('k') | chrome/browser/history/download_row.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ 5 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_
6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ 6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_
7 7
8 #include <vector>
9
8 #include "base/file_path.h" 10 #include "base/file_path.h"
9 #include "base/time.h" 11 #include "base/time.h"
12 #include "content/public/browser/download_danger_type.h"
13 #include "content/public/browser/download_interrupt_reasons.h"
10 #include "content/public/browser/download_item.h" 14 #include "content/public/browser/download_item.h"
11 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
12 16
13 namespace history { 17 namespace history {
14 18
15 // Contains the information that is stored in the download system's persistent 19 // Contains the information that is stored in the download system's persistent
16 // store (or refers to it). DownloadHistory uses this to communicate with the 20 // store (or refers to it). DownloadHistory uses this to communicate with the
17 // DownloadDatabase through the HistoryService. 21 // DownloadDatabase through the HistoryService.
18 struct DownloadRow { 22 struct DownloadRow {
19 DownloadRow(); 23 DownloadRow();
20 DownloadRow( 24 DownloadRow(
21 const FilePath& path, 25 const FilePath& current_path,
22 const GURL& url, 26 const FilePath& target_path,
27 const std::vector<GURL>& url_chain,
23 const GURL& referrer, 28 const GURL& referrer,
24 const base::Time& start, 29 const base::Time& start,
25 const base::Time& end, 30 const base::Time& end,
26 int64 received, 31 int64 received,
27 int64 total, 32 int64 total,
28 content::DownloadItem::DownloadState download_state, 33 content::DownloadItem::DownloadState download_state,
34 content::DownloadDangerType danger_type,
35 content::DownloadInterruptReason interrupt_reason,
29 int64 handle, 36 int64 handle,
30 bool download_opened); 37 bool download_opened);
31 ~DownloadRow(); 38 ~DownloadRow();
32 39
33 // The current path to the downloaded file. 40 // The current path to the download (potentially different from final if
34 // TODO(benjhayden/asanka): Persist the target filename as well. 41 // download is in progress or interrupted).
35 FilePath path; 42 FilePath current_path;
36 43
37 // The URL from which we are downloading. This is the final URL after any 44 // The target path where the download will go when it's complete.
38 // redirection by the server for |url_chain|. Is not changed by 45 FilePath target_path;
46
47 // The URL redirect chain through which we are downloading. The front
48 // is the url that the initial request went to, and the back is the
49 // url from which we ended up getting data. This is not changed by
39 // UpdateDownload(). 50 // UpdateDownload().
40 GURL url; 51 std::vector<GURL> url_chain;
41 52
42 // The URL that referred us. Is not changed by UpdateDownload(). 53 // The URL that referred us. Is not changed by UpdateDownload().
43 GURL referrer_url; 54 GURL referrer_url;
44 55
45 // The time when the download started. Is not changed by UpdateDownload(). 56 // The time when the download started. Is not changed by UpdateDownload().
46 base::Time start_time; 57 base::Time start_time;
47 58
48 // The time when the download completed. 59 // The time when the download completed.
49 base::Time end_time; 60 base::Time end_time;
50 61
51 // The number of bytes received (so far). 62 // The number of bytes received (so far).
52 int64 received_bytes; 63 int64 received_bytes;
53 64
54 // The total number of bytes in the download. Is not changed by 65 // The total number of bytes in the download. Is not changed by
55 // UpdateDownload(). 66 // UpdateDownload().
56 int64 total_bytes; 67 int64 total_bytes;
57 68
58 // The current state of the download. 69 // The current state of the download.
59 content::DownloadItem::DownloadState state; 70 content::DownloadItem::DownloadState state;
60 71
72 // Whether and how the download is dangerous.
73 content::DownloadDangerType danger_type;
74
75 // The reason the download was interrupted, if
76 // state == DownloadItem::INTERRUPTED
77 content::DownloadInterruptReason interrupt_reason;
78
61 // The handle of the download in the database. Is not changed by 79 // The handle of the download in the database. Is not changed by
62 // UpdateDownload(). 80 // UpdateDownload().
63 int64 db_handle; 81 int64 db_handle;
64 82
65 // Whether this download has ever been opened from the browser. 83 // Whether this download has ever been opened from the browser.
66 bool opened; 84 bool opened;
67 }; 85 };
68 86
69 } // namespace history 87 } // namespace history
70 88
71 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ 89 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/download_database.cc ('k') | chrome/browser/history/download_row.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698