Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: chrome/browser/history/download_history_info.h

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/download_history_info.h
diff --git a/chrome/browser/history/download_history_info.h b/chrome/browser/history/download_history_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..cddb7625403b6ac788b8a714ff86e50ea8e56d15
--- /dev/null
+++ b/chrome/browser/history/download_history_info.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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 "Download creation struct" applicable here?
ahendrickson 2011/05/19 20:16:49 Fixed.
+
+#ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_
+#define CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_
+#pragma once
+
+#include <vector>
+
+#include "base/file_path.h"
+#include "base/time.h"
+#include "googleurl/src/gurl.h"
+
+class DownloadItem;
+
+// 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.
+// to it).
+struct DownloadHistoryInfo {
+ 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
+ explicit DownloadHistoryInfo(const DownloadItem& item);
+ DownloadHistoryInfo(const std::vector<GURL>& url,
+ const GURL& referrer,
+ int64 total_bytes);
+ DownloadHistoryInfo(const FilePath& path,
+ const GURL& url,
+ const base::Time& start,
+ int64 received,
+ int64 total,
+ int32 download_state);
+ DownloadHistoryInfo(const FilePath& path,
+ const std::vector<GURL>& url,
+ const GURL& referrer,
+ const base::Time& start,
+ int64 received,
+ int64 total,
+ int32 download_state,
+ int64 handle,
+ int32 id);
+
+ // 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;
+
+ // Download ID assigned by DownloadResourceHandler.
+ // Used by the history back end, to return in a callback.
+ int32 download_id;
+
+ // The final path where the download is saved.
+ FilePath path;
+
+ // The chain of redirects that leading up to and including the final URL.
+ std::vector<GURL> url_chain;
+
+ // The URL that referred us.
+ GURL referrer_url;
+
+ 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.
+
+ int64 received_bytes;
+
+ int64 total_bytes;
+
+ int32 state;
+
+ int64 db_handle;
+};
+
+#endif // CHROME_BROWSER_HISTORY_DOWNLOAD_HISTORY_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698