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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 557 |
558 // TODO(mmenke): This should really be with the other code to set the upload | 558 // TODO(mmenke): This should really be with the other code to set the upload |
559 // body, below. | 559 // body, below. |
560 if (chunked_stream_) | 560 if (chunked_stream_) |
561 request_->set_upload(std::move(chunked_stream_)); | 561 request_->set_upload(std::move(chunked_stream_)); |
562 | 562 |
563 request_->SetLoadFlags(flags); | 563 request_->SetLoadFlags(flags); |
564 request_->SetReferrer(referrer_); | 564 request_->SetReferrer(referrer_); |
565 request_->set_referrer_policy(referrer_policy_); | 565 request_->set_referrer_policy(referrer_policy_); |
566 request_->set_first_party_for_cookies(initiator_.has_value() && | 566 request_->set_first_party_for_cookies(initiator_.has_value() && |
567 !initiator_.value().unique() | 567 !initiator_.value().opaque() |
568 ? initiator_.value().GetURL() | 568 ? initiator_.value().GetURL() |
569 : original_url_); | 569 : original_url_); |
570 request_->set_initiator(initiator_); | 570 request_->set_initiator(initiator_); |
571 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { | 571 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { |
572 request_->SetUserData(url_request_data_key_, | 572 request_->SetUserData(url_request_data_key_, |
573 url_request_create_data_callback_.Run()); | 573 url_request_create_data_callback_.Run()); |
574 } | 574 } |
575 | 575 |
576 switch (request_type_) { | 576 switch (request_type_) { |
577 case URLFetcher::GET: | 577 case URLFetcher::GET: |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 } | 955 } |
956 | 956 |
957 void URLFetcherCore::AssertHasNoUploadData() const { | 957 void URLFetcherCore::AssertHasNoUploadData() const { |
958 DCHECK(!upload_content_set_); | 958 DCHECK(!upload_content_set_); |
959 DCHECK(upload_content_.empty()); | 959 DCHECK(upload_content_.empty()); |
960 DCHECK(upload_file_path_.empty()); | 960 DCHECK(upload_file_path_.empty()); |
961 DCHECK(upload_stream_factory_.is_null()); | 961 DCHECK(upload_stream_factory_.is_null()); |
962 } | 962 } |
963 | 963 |
964 } // namespace net | 964 } // namespace net |
OLD | NEW |