| 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 #include "net/url_request/url_request.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 DCHECK(!is_pending_); | 448 DCHECK(!is_pending_); |
| 449 first_party_for_cookies_ = first_party_for_cookies; | 449 first_party_for_cookies_ = first_party_for_cookies; |
| 450 } | 450 } |
| 451 | 451 |
| 452 void URLRequest::set_first_party_url_policy( | 452 void URLRequest::set_first_party_url_policy( |
| 453 FirstPartyURLPolicy first_party_url_policy) { | 453 FirstPartyURLPolicy first_party_url_policy) { |
| 454 DCHECK(!is_pending_); | 454 DCHECK(!is_pending_); |
| 455 first_party_url_policy_ = first_party_url_policy; | 455 first_party_url_policy_ = first_party_url_policy; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void URLRequest::set_insecure_request_policy( |
| 459 InsecureRequestPolicy insecure_request_policy) { |
| 460 DCHECK(!is_pending_); |
| 461 insecure_request_policy_ = insecure_request_policy; |
| 462 } |
| 463 |
| 458 void URLRequest::set_initiator(const url::Origin& initiator) { | 464 void URLRequest::set_initiator(const url::Origin& initiator) { |
| 459 DCHECK(!is_pending_); | 465 DCHECK(!is_pending_); |
| 460 initiator_ = initiator; | 466 initiator_ = initiator; |
| 461 } | 467 } |
| 462 | 468 |
| 463 void URLRequest::set_method(const std::string& method) { | 469 void URLRequest::set_method(const std::string& method) { |
| 464 DCHECK(!is_pending_); | 470 DCHECK(!is_pending_); |
| 465 method_ = method; | 471 method_ = method; |
| 466 } | 472 } |
| 467 | 473 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 NetworkDelegate* network_delegate) | 545 NetworkDelegate* network_delegate) |
| 540 : context_(context), | 546 : context_(context), |
| 541 network_delegate_(network_delegate ? network_delegate | 547 network_delegate_(network_delegate ? network_delegate |
| 542 : context->network_delegate()), | 548 : context->network_delegate()), |
| 543 net_log_( | 549 net_log_( |
| 544 BoundNetLog::Make(context->net_log(), NetLog::SOURCE_URL_REQUEST)), | 550 BoundNetLog::Make(context->net_log(), NetLog::SOURCE_URL_REQUEST)), |
| 545 url_chain_(1, url), | 551 url_chain_(1, url), |
| 546 method_("GET"), | 552 method_("GET"), |
| 547 referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE), | 553 referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE), |
| 548 first_party_url_policy_(NEVER_CHANGE_FIRST_PARTY_URL), | 554 first_party_url_policy_(NEVER_CHANGE_FIRST_PARTY_URL), |
| 555 insecure_request_policy_(DO_NOT_UPGRADE_INSECURE_REQUESTS), |
| 549 load_flags_(LOAD_NORMAL), | 556 load_flags_(LOAD_NORMAL), |
| 550 delegate_(delegate), | 557 delegate_(delegate), |
| 551 is_pending_(false), | 558 is_pending_(false), |
| 552 is_redirecting_(false), | 559 is_redirecting_(false), |
| 553 redirect_limit_(kMaxRedirects), | 560 redirect_limit_(kMaxRedirects), |
| 554 priority_(priority), | 561 priority_(priority), |
| 555 identifier_(GenerateURLRequestIdentifier()), | 562 identifier_(GenerateURLRequestIdentifier()), |
| 556 calling_delegate_(false), | 563 calling_delegate_(false), |
| 557 use_blocked_by_as_load_param_(false), | 564 use_blocked_by_as_load_param_(false), |
| 558 before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete, | 565 before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete, |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 } | 1207 } |
| 1201 | 1208 |
| 1202 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1209 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 1203 if (job_) | 1210 if (job_) |
| 1204 job_->GetConnectionAttempts(out); | 1211 job_->GetConnectionAttempts(out); |
| 1205 else | 1212 else |
| 1206 out->clear(); | 1213 out->clear(); |
| 1207 } | 1214 } |
| 1208 | 1215 |
| 1209 } // namespace net | 1216 } // namespace net |
| OLD | NEW |