Chromium Code Reviews| Index: chrome/browser/download/download_create_info.h |
| diff --git a/chrome/browser/download/download_create_info.h b/chrome/browser/download/download_create_info.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d8089df8f804bd36dcbea0d9608b79fe60d3c60b |
| --- /dev/null |
| +++ b/chrome/browser/download/download_create_info.h |
| @@ -0,0 +1,92 @@ |
| +// 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
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +// |
| +// 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.
|
| + |
| +#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| +#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
|
| +#pragma once |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/file_path.h" |
| +#include "base/time.h" |
| +#include "chrome/browser/download/download_file.h" |
| +#include "chrome/browser/download/download_process_handle.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +// Used for informing the download database of a new download, where we don't |
| +// 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.
|
| +// vector of these structs for passing us the state of all downloads at |
| +// initialization time (see DownloadQueryInfo below). |
| +struct DownloadCreateInfo { |
| + DownloadCreateInfo(const FilePath& path, |
| + const GURL& url, |
| + 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.
|
| + int64 received_bytes, |
| + int64 total_bytes, |
| + int32 state, |
| + int32 download_id, |
| + bool has_user_gesture); |
| + DownloadCreateInfo(); |
| + ~DownloadCreateInfo(); |
| + |
| + // 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.
|
| + bool IsDangerous(); |
| + |
| + std::string DebugString() const; |
| + |
| + // The URL from which we are downloading. This is the final URL after any |
| + // redirection by the server for |url_chain|. |
| + const GURL& url() const; |
| + |
| + // 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.
|
| + FilePath path; |
| + // The chain of redirects that leading up to and including the final URL. |
| + std::vector<GURL> url_chain; |
| + GURL referrer_url; |
| + FilePath suggested_path; |
| + // A number that should be added to the suggested path to make it unique. |
| + // 0 means no number should be appended. Not actually stored in the db. |
| + int path_uniquifier; |
| + base::Time start_time; |
| + int64 received_bytes; |
| + int64 total_bytes; |
| + int32 state; |
| + int32 download_id; |
| + bool has_user_gesture; |
| + // The handle to the process information. Used for operations outside the |
| + // download system. |
| + DownloadProcessHandle process_handle; |
| + int64 db_handle; |
| + std::string content_disposition; |
| + std::string mime_type; |
| + // The value of the content type header sent with the downloaded item. It |
| + // may be different from |mime_type|, which may be set based on heuristics |
| + // which may look at the file extension and first few bytes of the file. |
| + std::string original_mime_type; |
| + |
| + // True if we should display the 'save as...' UI and prompt the user |
| + // for the download location. |
| + // False if the UI should be supressed and the download performed to the |
| + // default location. |
| + 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.
|
| + // Whether this download file is potentially dangerous (ex: exe, dll, ...). |
| + bool is_dangerous_file; |
| + // If safebrowsing believes this URL leads to malware. |
| + bool is_dangerous_url; |
| + // The original name for a dangerous download. |
| + FilePath original_name; |
| + // Whether this download is for extension install or not. |
| + bool is_extension_install; |
| + // The charset of the referring page where the download request comes from. |
| + // It's used to construct a suggested filename. |
| + std::string referrer_charset; |
| + // The download file save info. |
| + DownloadSaveInfo save_info; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |