| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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 // Download struct used for informing and querying the history service. |
| 6 |
| 7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_ |
| 8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_ |
| 9 #pragma once |
| 10 |
| 11 #include <vector> |
| 12 |
| 13 #include "base/file_path.h" |
| 14 #include "base/time.h" |
| 15 #include "googleurl/src/gurl.h" |
| 16 |
| 17 class DownloadItem; |
| 18 |
| 19 // Contains the information that is stored in the download history database |
| 20 // (or refers to it). Managed by the DownloadItem. |
| 21 struct DownloadHistoryInfo { |
| 22 // TODO(ahendrickson) -- Reduce the number of constructors. |
| 23 DownloadHistoryInfo(); |
| 24 DownloadHistoryInfo(const std::vector<GURL>& url, |
| 25 const GURL& referrer, |
| 26 int64 total_bytes); |
| 27 DownloadHistoryInfo(const FilePath& path, |
| 28 const GURL& url, |
| 29 const base::Time& start, |
| 30 int64 received, |
| 31 int64 total, |
| 32 int32 download_state); |
| 33 DownloadHistoryInfo(const FilePath& path, |
| 34 const std::vector<GURL>& url, |
| 35 const GURL& referrer, |
| 36 const base::Time& start, |
| 37 int64 received, |
| 38 int64 total, |
| 39 int32 download_state, |
| 40 int64 handle, |
| 41 int32 id); |
| 42 |
| 43 // The URL from which we are downloading. This is the final URL after any |
| 44 // redirection by the server for |url_chain|. |
| 45 const GURL& url() const; |
| 46 |
| 47 // Download ID assigned by DownloadResourceHandler. |
| 48 // Used by the history back end, to return in a callback. |
| 49 int32 download_id; |
| 50 |
| 51 // The final path where the download is saved. |
| 52 FilePath path; |
| 53 |
| 54 // The chain of redirects that leading up to and including the final URL. |
| 55 std::vector<GURL> url_chain; |
| 56 |
| 57 // The URL that referred us. |
| 58 GURL referrer_url; |
| 59 |
| 60 // The time when the download started. |
| 61 base::Time start_time; |
| 62 |
| 63 // The number of bytes received (so far). |
| 64 int64 received_bytes; |
| 65 |
| 66 // The total number of bytes in the download. |
| 67 int64 total_bytes; |
| 68 |
| 69 // The current state of the download. |
| 70 int32 state; |
| 71 |
| 72 // The handle of the download in the database. |
| 73 int64 db_handle; |
| 74 }; |
| 75 |
| 76 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_ |
| OLD | NEW |