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

Unified Diff: content/browser/download/download_create_info.h

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_create_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_create_info.h
diff --git a/content/browser/download/download_create_info.h b/content/browser/download/download_create_info.h
index 4326b2428b0eebd928d7d91481f4ff752d6e0f75..83b939f35b0a298ba2af6ca642f821bfab1e89ac 100644
--- a/content/browser/download/download_create_info.h
+++ b/content/browser/download/download_create_info.h
@@ -13,14 +13,17 @@
#include "base/time/time.h"
#include "content/browser/download/download_file.h"
#include "content/browser/download/download_request_handle.h"
+#include "content/browser/loader/global_routing_id.h"
#include "content/common/content_export.h"
-#include "content/public/browser/download_save_info.h"
#include "content/public/common/page_transition_types.h"
#include "net/base/net_log.h"
#include "url/gurl.h"
namespace content {
+class ByteStreamReader;
+struct DownloadSaveInfo;
+
// Used for informing the download manager of a new download, since we don't
// want to pass |DownloadItem|s between threads.
struct CONTENT_EXPORT DownloadCreateInfo {
@@ -28,10 +31,17 @@ struct CONTENT_EXPORT DownloadCreateInfo {
int64 total_bytes,
const net::BoundNetLog& bound_net_log,
bool has_user_gesture,
- PageTransition transition_type);
+ PageTransition transition_type,
+ scoped_ptr<DownloadSaveInfo> save_info);
DownloadCreateInfo();
~DownloadCreateInfo();
+ // True if this is a SavePackage download. Such downloads aren't associated
+ // with a URLRequest and the download process is managed by SavePackage.
+ // TODO(asanka): Get rid of this when SavePackage downloads share more code
+ // with the rest of the downloads system. http://crbug.com/6025
+ bool is_save_package_download;
+
std::string DebugString() const;
// The URL from which we are downloading. This is the final URL after any
@@ -50,9 +60,6 @@ struct CONTENT_EXPORT DownloadCreateInfo {
// The total download size.
int64 total_bytes;
- // The ID of the download.
- uint32 download_id;
-
// True if the download was initiated by user action.
bool has_user_gesture;
@@ -80,12 +87,16 @@ struct CONTENT_EXPORT DownloadCreateInfo {
// The download file save info.
scoped_ptr<DownloadSaveInfo> save_info;
+ // Stream reader.
+ scoped_ptr<ByteStreamReader> stream_reader;
+
// The remote IP address where the download was fetched from. Copied from
// UrlRequest::GetSocketAddress().
std::string remote_address;
- // The handle to the URLRequest sourcing this download.
- DownloadRequestHandle request_handle;
+ // Route associated with this download. This is used to locate the associated
+ // WebContents if one is available.
+ GlobalRoutingID route_id;
// The request's |BoundNetLog|, for "source_dependency" linking with the
// download item's.
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_create_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698