| 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_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 // TODO(mmenke): This should really be with the other code to set the upload | 561 // TODO(mmenke): This should really be with the other code to set the upload |
| 562 // body, below. | 562 // body, below. |
| 563 if (chunked_stream_) | 563 if (chunked_stream_) |
| 564 request_->set_upload(std::move(chunked_stream_)); | 564 request_->set_upload(std::move(chunked_stream_)); |
| 565 | 565 |
| 566 request_->SetLoadFlags(flags); | 566 request_->SetLoadFlags(flags); |
| 567 request_->SetReferrer(referrer_); | 567 request_->SetReferrer(referrer_); |
| 568 request_->set_referrer_policy(referrer_policy_); | 568 request_->set_referrer_policy(referrer_policy_); |
| 569 request_->set_site_for_cookies(initiator_.has_value() && | 569 request_->set_site_for_cookies(initiator_.has_value() && |
| 570 !initiator_.value().unique() | 570 !initiator_.value().opaque() |
| 571 ? initiator_.value().GetURL() | 571 ? initiator_.value().GetURL() |
| 572 : original_url_); | 572 : original_url_); |
| 573 request_->set_initiator(initiator_); | 573 request_->set_initiator(initiator_); |
| 574 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { | 574 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { |
| 575 request_->SetUserData(url_request_data_key_, | 575 request_->SetUserData(url_request_data_key_, |
| 576 url_request_create_data_callback_.Run()); | 576 url_request_create_data_callback_.Run()); |
| 577 } | 577 } |
| 578 | 578 |
| 579 switch (request_type_) { | 579 switch (request_type_) { |
| 580 case URLFetcher::GET: | 580 case URLFetcher::GET: |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 } | 958 } |
| 959 | 959 |
| 960 void URLFetcherCore::AssertHasNoUploadData() const { | 960 void URLFetcherCore::AssertHasNoUploadData() const { |
| 961 DCHECK(!upload_content_set_); | 961 DCHECK(!upload_content_set_); |
| 962 DCHECK(upload_content_.empty()); | 962 DCHECK(upload_content_.empty()); |
| 963 DCHECK(upload_file_path_.empty()); | 963 DCHECK(upload_file_path_.empty()); |
| 964 DCHECK(upload_stream_factory_.is_null()); | 964 DCHECK(upload_stream_factory_.is_null()); |
| 965 } | 965 } |
| 966 | 966 |
| 967 } // namespace net | 967 } // namespace net |
| OLD | NEW |