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

Side by Side Diff: content/public/browser/download_url_parameters.h

Issue 2880933002: Download driver for components/download. (Closed)
Patch Set: Polish comment. Created 3 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 unified diff | Download patch
« no previous file with comments | « content/public/browser/download_manager.h ('k') | content/public/test/fake_download_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; } 202 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; }
203 void set_file(base::File file) { save_info_.file = std::move(file); } 203 void set_file(base::File file) { save_info_.file = std::move(file); }
204 void set_do_not_prompt_for_login(bool do_not_prompt) { 204 void set_do_not_prompt_for_login(bool do_not_prompt) {
205 do_not_prompt_for_login_ = do_not_prompt; 205 do_not_prompt_for_login_ = do_not_prompt;
206 } 206 }
207 207
208 // Sets whether the download is to be treated as transient. A transient 208 // Sets whether the download is to be treated as transient. A transient
209 // download is short-lived and is not shown in the UI. 209 // download is short-lived and is not shown in the UI.
210 void set_transient(bool transient) { transient_ = transient; } 210 void set_transient(bool transient) { transient_ = transient; }
211 211
212 // Sets the optional guid for the download, the guid serves as the unique
213 // identitfier for the download item. If no guid is provided, download
214 // system will automatically generate one.
215 void set_guid(const std::string& guid) { guid_ = guid; }
216
212 // For downloads of blob URLs, the caller can store a BlobDataHandle in the 217 // For downloads of blob URLs, the caller can store a BlobDataHandle in the
213 // DownloadUrlParameters object so that the blob will remain valid until 218 // DownloadUrlParameters object so that the blob will remain valid until
214 // the download starts. The BlobDataHandle will be attached to the associated 219 // the download starts. The BlobDataHandle will be attached to the associated
215 // URLRequest. 220 // URLRequest.
216 // 221 //
217 // This is optional. If left unspecified, and the blob URL cannot be mapped to 222 // This is optional. If left unspecified, and the blob URL cannot be mapped to
218 // a blob by the time the download request starts, then the download will 223 // a blob by the time the download request starts, then the download will
219 // fail. 224 // fail.
220 void set_blob_data_handle( 225 void set_blob_data_handle(
221 std::unique_ptr<storage::BlobDataHandle> blob_data_handle) { 226 std::unique_ptr<storage::BlobDataHandle> blob_data_handle) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 260 }
256 int64_t offset() const { return save_info_.offset; } 261 int64_t offset() const { return save_info_.offset; }
257 int64_t length() const { return save_info_.length; } 262 int64_t length() const { return save_info_.length; }
258 const std::string& hash_of_partial_file() const { 263 const std::string& hash_of_partial_file() const {
259 return save_info_.hash_of_partial_file; 264 return save_info_.hash_of_partial_file;
260 } 265 }
261 bool prompt() const { return save_info_.prompt_for_save_location; } 266 bool prompt() const { return save_info_.prompt_for_save_location; }
262 const GURL& url() const { return url_; } 267 const GURL& url() const { return url_; }
263 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } 268 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; }
264 bool is_transient() const { return transient_; } 269 bool is_transient() const { return transient_; }
270 std::string guid() const { return guid_; }
265 271
266 // STATE_CHANGING: Return the BlobDataHandle. 272 // STATE_CHANGING: Return the BlobDataHandle.
267 std::unique_ptr<storage::BlobDataHandle> GetBlobDataHandle() { 273 std::unique_ptr<storage::BlobDataHandle> GetBlobDataHandle() {
268 return std::move(blob_data_handle_); 274 return std::move(blob_data_handle_);
269 } 275 }
270 276
271 // STATE CHANGING: All save_info_ sub-objects will be in an indeterminate 277 // STATE CHANGING: All save_info_ sub-objects will be in an indeterminate
272 // state following this call. 278 // state following this call.
273 DownloadSaveInfo GetSaveInfo() { return std::move(save_info_); } 279 DownloadSaveInfo GetSaveInfo() { return std::move(save_info_); }
274 280
(...skipping 12 matching lines...) Expand all
287 base::Optional<url::Origin> initiator_; 293 base::Optional<url::Origin> initiator_;
288 std::string referrer_encoding_; 294 std::string referrer_encoding_;
289 int render_process_host_id_; 295 int render_process_host_id_;
290 int render_view_host_routing_id_; 296 int render_view_host_routing_id_;
291 int render_frame_host_routing_id_; 297 int render_frame_host_routing_id_;
292 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; 298 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
293 DownloadSaveInfo save_info_; 299 DownloadSaveInfo save_info_;
294 GURL url_; 300 GURL url_;
295 bool do_not_prompt_for_login_; 301 bool do_not_prompt_for_login_;
296 bool transient_; 302 bool transient_;
303 std::string guid_;
297 std::unique_ptr<storage::BlobDataHandle> blob_data_handle_; 304 std::unique_ptr<storage::BlobDataHandle> blob_data_handle_;
298 305
299 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); 306 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters);
300 }; 307 };
301 308
302 } // namespace content 309 } // namespace content
303 310
304 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 311 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
OLDNEW
« no previous file with comments | « content/public/browser/download_manager.h ('k') | content/public/test/fake_download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698