| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void set_last_modified(const std::string& last_modified) { | 120 void set_last_modified(const std::string& last_modified) { |
| 121 last_modified_ = last_modified; | 121 last_modified_ = last_modified; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // If this is a request for resuming an HTTP/S download, |etag| should be the | 124 // If this is a request for resuming an HTTP/S download, |etag| should be the |
| 125 // last seen Etag response header. | 125 // last seen Etag response header. |
| 126 void set_etag(const std::string& etag) { | 126 void set_etag(const std::string& etag) { |
| 127 etag_ = etag; | 127 etag_ = etag; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // If the "If-Range" header is used in a partial request. |
| 131 void set_use_if_range(bool use_if_range) { use_if_range_ = use_if_range; } |
| 132 |
| 130 // HTTP method to use. | 133 // HTTP method to use. |
| 131 void set_method(const std::string& method) { | 134 void set_method(const std::string& method) { |
| 132 method_ = method; | 135 method_ = method; |
| 133 } | 136 } |
| 134 | 137 |
| 135 // Body of the HTTP POST request. | 138 // Body of the HTTP POST request. |
| 136 void set_post_body(const std::string& post_body) { | 139 void set_post_body(const std::string& post_body) { |
| 137 post_body_ = post_body; | 140 post_body_ = post_body; |
| 138 } | 141 } |
| 139 | 142 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // fail. | 215 // fail. |
| 213 void set_blob_data_handle( | 216 void set_blob_data_handle( |
| 214 std::unique_ptr<storage::BlobDataHandle> blob_data_handle) { | 217 std::unique_ptr<storage::BlobDataHandle> blob_data_handle) { |
| 215 blob_data_handle_ = std::move(blob_data_handle); | 218 blob_data_handle_ = std::move(blob_data_handle); |
| 216 } | 219 } |
| 217 | 220 |
| 218 const OnStartedCallback& callback() const { return callback_; } | 221 const OnStartedCallback& callback() const { return callback_; } |
| 219 bool content_initiated() const { return content_initiated_; } | 222 bool content_initiated() const { return content_initiated_; } |
| 220 const std::string& last_modified() const { return last_modified_; } | 223 const std::string& last_modified() const { return last_modified_; } |
| 221 const std::string& etag() const { return etag_; } | 224 const std::string& etag() const { return etag_; } |
| 225 bool use_if_range() const { return use_if_range_; } |
| 222 const std::string& method() const { return method_; } | 226 const std::string& method() const { return method_; } |
| 223 const std::string& post_body() const { return post_body_; } | 227 const std::string& post_body() const { return post_body_; } |
| 224 int64_t post_id() const { return post_id_; } | 228 int64_t post_id() const { return post_id_; } |
| 225 bool prefer_cache() const { return prefer_cache_; } | 229 bool prefer_cache() const { return prefer_cache_; } |
| 226 const Referrer& referrer() const { return referrer_; } | 230 const Referrer& referrer() const { return referrer_; } |
| 227 const std::string& referrer_encoding() const { return referrer_encoding_; } | 231 const std::string& referrer_encoding() const { return referrer_encoding_; } |
| 228 const base::Optional<url::Origin>& initiator() const { return initiator_; } | 232 const base::Optional<url::Origin>& initiator() const { return initiator_; } |
| 229 | 233 |
| 230 // These will be -1 if the request is not associated with a frame. See | 234 // These will be -1 if the request is not associated with a frame. See |
| 231 // the constructors for more. | 235 // the constructors for more. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 262 // STATE CHANGING: All save_info_ sub-objects will be in an indeterminate | 266 // STATE CHANGING: All save_info_ sub-objects will be in an indeterminate |
| 263 // state following this call. | 267 // state following this call. |
| 264 DownloadSaveInfo GetSaveInfo() { return std::move(save_info_); } | 268 DownloadSaveInfo GetSaveInfo() { return std::move(save_info_); } |
| 265 | 269 |
| 266 private: | 270 private: |
| 267 OnStartedCallback callback_; | 271 OnStartedCallback callback_; |
| 268 bool content_initiated_; | 272 bool content_initiated_; |
| 269 RequestHeadersType request_headers_; | 273 RequestHeadersType request_headers_; |
| 270 std::string last_modified_; | 274 std::string last_modified_; |
| 271 std::string etag_; | 275 std::string etag_; |
| 276 bool use_if_range_; |
| 272 std::string method_; | 277 std::string method_; |
| 273 std::string post_body_; | 278 std::string post_body_; |
| 274 int64_t post_id_; | 279 int64_t post_id_; |
| 275 bool prefer_cache_; | 280 bool prefer_cache_; |
| 276 Referrer referrer_; | 281 Referrer referrer_; |
| 277 base::Optional<url::Origin> initiator_; | 282 base::Optional<url::Origin> initiator_; |
| 278 std::string referrer_encoding_; | 283 std::string referrer_encoding_; |
| 279 int render_process_host_id_; | 284 int render_process_host_id_; |
| 280 int render_view_host_routing_id_; | 285 int render_view_host_routing_id_; |
| 281 int render_frame_host_routing_id_; | 286 int render_frame_host_routing_id_; |
| 282 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 287 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
| 283 DownloadSaveInfo save_info_; | 288 DownloadSaveInfo save_info_; |
| 284 GURL url_; | 289 GURL url_; |
| 285 bool do_not_prompt_for_login_; | 290 bool do_not_prompt_for_login_; |
| 286 std::unique_ptr<storage::BlobDataHandle> blob_data_handle_; | 291 std::unique_ptr<storage::BlobDataHandle> blob_data_handle_; |
| 287 | 292 |
| 288 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); | 293 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); |
| 289 }; | 294 }; |
| 290 | 295 |
| 291 } // namespace content | 296 } // namespace content |
| 292 | 297 |
| 293 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 298 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| OLD | NEW |