Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_PERSISTENT_STORE_INFO_H_ | |
| 6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_PERSISTENT_STORE_INFO_H_ | |
| 7 | |
| 8 #include "base/file_path.h" | |
| 9 #include "base/time.h" | |
| 10 #include "content/public/browser/download_item.h" | |
| 11 #include "googleurl/src/gurl.h" | |
| 12 | |
| 13 // Contains the information that is stored in the download system's persistent | |
| 14 // store (or refers to it). DownloadHistory uses this to communicate with the | |
| 15 // DownloadDatabase through the HistoryService. | |
| 16 struct DownloadPersistentStoreInfo { | |
|
sky
2012/11/13 20:45:52
If you're putting this in the history directory it
benjhayden
2012/11/13 21:24:14
Done.
| |
| 17 DownloadPersistentStoreInfo(); | |
| 18 DownloadPersistentStoreInfo( | |
| 19 const FilePath& path, | |
| 20 const GURL& url, | |
| 21 const GURL& referrer, | |
| 22 const base::Time& start, | |
| 23 const base::Time& end, | |
| 24 int64 received, | |
| 25 int64 total, | |
| 26 content::DownloadItem::DownloadState download_state, | |
| 27 int64 handle, | |
| 28 bool download_opened); | |
| 29 ~DownloadPersistentStoreInfo(); | |
| 30 | |
| 31 // The current path to the downloaded file. | |
| 32 // TODO(benjhayden/asanka): Persist the target filename as well. | |
| 33 FilePath path; | |
| 34 | |
| 35 // The URL from which we are downloading. This is the final URL after any | |
| 36 // redirection by the server for |url_chain|. Is not changed by | |
| 37 // UpdateDownload(). | |
| 38 GURL url; | |
| 39 | |
| 40 // The URL that referred us. Is not changed by UpdateDownload(). | |
| 41 GURL referrer_url; | |
| 42 | |
| 43 // The time when the download started. Is not changed by UpdateDownload(). | |
| 44 base::Time start_time; | |
| 45 | |
| 46 // The time when the download completed. | |
| 47 base::Time end_time; | |
| 48 | |
| 49 // The number of bytes received (so far). | |
| 50 int64 received_bytes; | |
| 51 | |
| 52 // The total number of bytes in the download. Is not changed by | |
| 53 // UpdateDownload(). | |
| 54 int64 total_bytes; | |
| 55 | |
| 56 // The current state of the download. | |
| 57 content::DownloadItem::DownloadState state; | |
| 58 | |
| 59 // The handle of the download in the database. Is not changed by | |
| 60 // UpdateDownload(). | |
| 61 int64 db_handle; | |
| 62 | |
| 63 // Whether this download has ever been opened from the browser. | |
| 64 bool opened; | |
| 65 }; | |
| 66 | |
| 67 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_PERSISTENT_STORE_INFO_H_ | |
| OLD | NEW |