OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
Randy Smith (Not in Mondays)
2011/05/19 17:05:27
I don't see the corresponding delete to this creat
ahendrickson
2011/05/19 20:16:49
That's odd.
On my machine, it detected that Downl
| |
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 it really primarily used for querying the histo
ahendrickson
2011/05/19 20:16:49
Fixed.
| |
6 | |
7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | |
8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
Is this file moved from chrome/browser/history? I
ahendrickson
2011/05/19 20:16:49
Yes it is.
I'm not sure how to fix the CL, as it
Paweł Hajdan Jr.
2011/05/20 09:04:42
I see, I suspected that kind of problem. Should be
| |
9 #pragma once | |
10 | |
11 #include <string> | |
12 #include <vector> | |
13 | |
14 #include "base/basictypes.h" | |
15 #include "base/file_path.h" | |
16 #include "base/time.h" | |
17 #include "chrome/browser/download/download_file.h" | |
18 #include "chrome/browser/download/download_process_handle.h" | |
19 #include "googleurl/src/gurl.h" | |
20 | |
21 // Used for informing the download database of a new download, where we don't | |
22 // want to pass DownloadItems between threads. The history service also uses a | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
Let's describe the history service parts in Histor
ahendrickson
2011/05/19 20:16:49
Done.
| |
23 // vector of these structs for passing us the state of all downloads at | |
24 // initialization time (see DownloadQueryInfo below). | |
25 struct DownloadCreateInfo { | |
26 DownloadCreateInfo(const FilePath& path, | |
27 const GURL& url, | |
28 base::Time start_time, | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
nit: Why not const base::Time& for consistency wit
ahendrickson
2011/05/19 20:16:49
Done.
| |
29 int64 received_bytes, | |
30 int64 total_bytes, | |
31 int32 state, | |
32 int32 download_id, | |
33 bool has_user_gesture); | |
34 DownloadCreateInfo(); | |
35 ~DownloadCreateInfo(); | |
36 | |
37 // Indicates if the download is dangerous. | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
nit: "Indicates" -> "Returns true". Why not const?
ahendrickson
2011/05/19 20:16:49
Done.
| |
38 bool IsDangerous(); | |
39 | |
40 std::string DebugString() const; | |
41 | |
42 // The URL from which we are downloading. This is the final URL after any | |
43 // redirection by the server for |url_chain|. | |
44 const GURL& url() const; | |
45 | |
46 // DownloadItem fields | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
Instead of saying DownloadItem fields, please make
ahendrickson
2011/05/19 20:16:49
Done.
| |
47 FilePath path; | |
48 // The chain of redirects that leading up to and including the final URL. | |
49 std::vector<GURL> url_chain; | |
50 GURL referrer_url; | |
51 FilePath suggested_path; | |
52 // A number that should be added to the suggested path to make it unique. | |
53 // 0 means no number should be appended. Not actually stored in the db. | |
54 int path_uniquifier; | |
55 base::Time start_time; | |
56 int64 received_bytes; | |
57 int64 total_bytes; | |
58 int32 state; | |
59 int32 download_id; | |
60 bool has_user_gesture; | |
61 // The handle to the process information. Used for operations outside the | |
62 // download system. | |
63 DownloadProcessHandle process_handle; | |
64 int64 db_handle; | |
65 std::string content_disposition; | |
66 std::string mime_type; | |
67 // The value of the content type header sent with the downloaded item. It | |
68 // may be different from |mime_type|, which may be set based on heuristics | |
69 // which may look at the file extension and first few bytes of the file. | |
70 std::string original_mime_type; | |
71 | |
72 // True if we should display the 'save as...' UI and prompt the user | |
73 // for the download location. | |
74 // False if the UI should be supressed and the download performed to the | |
75 // default location. | |
76 bool prompt_user_for_save_location; | |
Paweł Hajdan Jr.
2011/05/19 16:18:25
nit: Please add empty lines between member variabl
ahendrickson
2011/05/19 20:16:49
Done.
| |
77 // Whether this download file is potentially dangerous (ex: exe, dll, ...). | |
78 bool is_dangerous_file; | |
79 // If safebrowsing believes this URL leads to malware. | |
80 bool is_dangerous_url; | |
81 // The original name for a dangerous download. | |
82 FilePath original_name; | |
83 // Whether this download is for extension install or not. | |
84 bool is_extension_install; | |
85 // The charset of the referring page where the download request comes from. | |
86 // It's used to construct a suggested filename. | |
87 std::string referrer_charset; | |
88 // The download file save info. | |
89 DownloadSaveInfo save_info; | |
90 }; | |
91 | |
92 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | |
OLD | NEW |