Chromium Code Reviews| 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 creation struct used for querying the history service. | |
|
Paweł Hajdan Jr.
2011/05/19 16:18:25
Is "Download creation struct" applicable here?
ahendrickson
2011/05/19 20:16:49
Fixed.
| |
| 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 History database (or refers | |
|
Paweł Hajdan Jr.
2011/05/19 16:18:25
nit: Make this comment say something about downloa
ahendrickson
2011/05/19 20:16:49
Done.
| |
| 20 // to it). | |
| 21 struct DownloadHistoryInfo { | |
| 22 DownloadHistoryInfo(); | |
|
Paweł Hajdan Jr.
2011/05/19 16:18:25
Why do we have 5 different ctors here? Could you r
ahendrickson
2011/05/19 20:16:49
They are all being used, mostly by DownloadItem's
Paweł Hajdan Jr.
2011/05/20 09:04:42
Right, if they're here they're obviously used by s
ahendrickson
2011/05/20 18:31:24
Done.
Randy Smith (Not in Mondays)
2011/05/20 18:35:25
You can't get rid of the default constructor becau
| |
| 23 explicit DownloadHistoryInfo(const DownloadItem& item); | |
| 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 base::Time start_time; | |
|
Paweł Hajdan Jr.
2011/05/19 16:18:25
nit: Please comment all member variables.
ahendrickson
2011/05/19 20:16:49
Done.
| |
| 61 | |
| 62 int64 received_bytes; | |
| 63 | |
| 64 int64 total_bytes; | |
| 65 | |
| 66 int32 state; | |
| 67 | |
| 68 int64 db_handle; | |
| 69 }; | |
| 70 | |
| 71 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_ | |
| OLD | NEW |