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

Side by Side Diff: net/url_request/url_fetcher_core.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Introduce NullableOrigin to use for request initiator Created 4 years, 2 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
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 #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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 // TODO(mmenke): This should really be with the other code to set the upload 553 // TODO(mmenke): This should really be with the other code to set the upload
554 // body, below. 554 // body, below.
555 if (chunked_stream_) 555 if (chunked_stream_)
556 request_->set_upload(std::move(chunked_stream_)); 556 request_->set_upload(std::move(chunked_stream_));
557 557
558 request_->SetLoadFlags(flags); 558 request_->SetLoadFlags(flags);
559 request_->SetReferrer(referrer_); 559 request_->SetReferrer(referrer_);
560 request_->set_referrer_policy(referrer_policy_); 560 request_->set_referrer_policy(referrer_policy_);
561 request_->set_first_party_for_cookies(initiator_.is_empty() ? original_url_ 561 request_->set_first_party_for_cookies(initiator_.is_empty() ? original_url_
562 : initiator_); 562 : initiator_);
563 request_->set_initiator(initiator_.is_empty() ? url::Origin(original_url_) 563 request_->set_initiator(initiator_.is_empty()
564 : url::Origin(initiator_)); 564 ? new url::NullableOrigin(original_url_)
565 : new url::NullableOrigin(initiator_));
565 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { 566 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) {
566 request_->SetUserData(url_request_data_key_, 567 request_->SetUserData(url_request_data_key_,
567 url_request_create_data_callback_.Run()); 568 url_request_create_data_callback_.Run());
568 } 569 }
569 570
570 switch (request_type_) { 571 switch (request_type_) {
571 case URLFetcher::GET: 572 case URLFetcher::GET:
572 break; 573 break;
573 574
574 case URLFetcher::POST: 575 case URLFetcher::POST:
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 } 949 }
949 950
950 void URLFetcherCore::AssertHasNoUploadData() const { 951 void URLFetcherCore::AssertHasNoUploadData() const {
951 DCHECK(!upload_content_set_); 952 DCHECK(!upload_content_set_);
952 DCHECK(upload_content_.empty()); 953 DCHECK(upload_content_.empty());
953 DCHECK(upload_file_path_.empty()); 954 DCHECK(upload_file_path_.empty());
954 DCHECK(upload_stream_factory_.is_null()); 955 DCHECK(upload_stream_factory_.is_null());
955 } 956 }
956 957
957 } // namespace net 958 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698