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

Side by Side Diff: content/browser/download/download_create_info.h

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "content/browser/download/download_file.h" 15 #include "content/browser/download/download_file.h"
16 #include "content/browser/download/interrupt_reasons.h"
16 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
17 #include "content/public/common/page_transition_types.h" 18 #include "content/public/common/page_transition_types.h"
18 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
19 20
20 // Used for informing the download manager of a new download, since we don't 21 // Used for informing the download manager of a new download, since we don't
21 // want to pass |DownloadItem|s between threads. 22 // want to pass |DownloadItem|s between threads.
22 struct CONTENT_EXPORT DownloadCreateInfo { 23 struct CONTENT_EXPORT DownloadCreateInfo {
23 DownloadCreateInfo(const FilePath& path, 24 DownloadCreateInfo(const FilePath& path,
24 const GURL& url, 25 const GURL& url,
25 const base::Time& start_time, 26 const base::Time& start_time,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 std::string content_disposition; 80 std::string content_disposition;
80 81
81 // The mime type string from the response header (may be overridden). 82 // The mime type string from the response header (may be overridden).
82 std::string mime_type; 83 std::string mime_type;
83 84
84 // The value of the content type header sent with the downloaded item. It 85 // The value of the content type header sent with the downloaded item. It
85 // may be different from |mime_type|, which may be set based on heuristics 86 // may be different from |mime_type|, which may be set based on heuristics
86 // which may look at the file extension and first few bytes of the file. 87 // which may look at the file extension and first few bytes of the file.
87 std::string original_mime_type; 88 std::string original_mime_type;
88 89
90 // For restarting a download, the modification time of the file.
91 std::string last_modified;
Randy Smith (Not in Mondays) 2011/10/31 18:46:43 Why is this a string rather than a base::Time or s
ahendrickson 2011/11/13 21:15:20 I wanted to return to the server the exact Last-Mo
Randy Smith (Not in Mondays) 2011/11/15 18:35:25 Would you do a little investigation of this issue?
ahendrickson 2011/11/16 15:41:08 In order to use base::Time, we would be converting
Randy Smith (Not in Mondays) 2011/11/16 18:29:27 Ok, but include a comment explaining the code smel
ahendrickson 2011/11/19 20:18:03 Done.
92
93 // For restarting a download, the ETAG of the file.
94 std::string etag;
95
96 // Is continuing a download.
97 bool continued_download;
Randy Smith (Not in Mondays) 2011/10/31 18:46:43 What's the use case for this field? Would it make
ahendrickson 2011/11/13 21:15:20 We do have the offset for the data being received.
Randy Smith (Not in Mondays) 2011/11/15 18:35:25 Sure, but I would imagine that distinction would b
ahendrickson 2011/11/16 15:41:08 Done.
98
99 // Server error code, if any.
100 InterruptReason server_interrupt_reason;
Randy Smith (Not in Mondays) 2011/10/31 18:46:43 What's the use case for this field? DownloadCreat
ahendrickson 2011/11/13 21:15:20 This is so we can pass in interrupt reasons that a
Randy Smith (Not in Mondays) 2011/11/15 18:35:25 Could you flesh out that use case? We already hav
ahendrickson 2011/11/16 15:41:08 Done.
101
89 // True if we should display the 'save as...' UI and prompt the user 102 // True if we should display the 'save as...' UI and prompt the user
90 // for the download location. 103 // for the download location.
91 // False if the UI should be supressed and the download performed to the 104 // False if the UI should be suppressed and the download performed to the
92 // default location. 105 // default location.
93 bool prompt_user_for_save_location; 106 bool prompt_user_for_save_location;
94 107
95 // The original name for a dangerous download. 108 // The original name for a dangerous download.
96 FilePath original_name; 109 FilePath original_name;
97 110
98 // The charset of the referring page where the download request comes from. 111 // The charset of the referring page where the download request comes from.
99 // It's used to construct a suggested filename. 112 // It's used to construct a suggested filename.
100 std::string referrer_charset; 113 std::string referrer_charset;
101 114
102 // The download file save info. 115 // The download file save info.
103 DownloadSaveInfo save_info; 116 DownloadSaveInfo save_info;
104 }; 117 };
105 118
106 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 119 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698