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

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

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month 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
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 DCHECK(!is_pending_); 461 DCHECK(!is_pending_);
462 first_party_for_cookies_ = first_party_for_cookies; 462 first_party_for_cookies_ = first_party_for_cookies;
463 } 463 }
464 464
465 void URLRequest::set_first_party_url_policy( 465 void URLRequest::set_first_party_url_policy(
466 FirstPartyURLPolicy first_party_url_policy) { 466 FirstPartyURLPolicy first_party_url_policy) {
467 DCHECK(!is_pending_); 467 DCHECK(!is_pending_);
468 first_party_url_policy_ = first_party_url_policy; 468 first_party_url_policy_ = first_party_url_policy;
469 } 469 }
470 470
471 void URLRequest::set_initiator(const url::Origin& initiator) { 471 void URLRequest::set_initiator(const base::Optional<url::Origin>& initiator) {
472 DCHECK(!is_pending_); 472 DCHECK(!is_pending_);
473 DCHECK(!initiator.has_value() || initiator.value().unique() ||
474 initiator.value().GetURL().is_valid());
473 initiator_ = initiator; 475 initiator_ = initiator;
474 } 476 }
475 477
476 void URLRequest::set_method(const std::string& method) { 478 void URLRequest::set_method(const std::string& method) {
477 DCHECK(!is_pending_); 479 DCHECK(!is_pending_);
478 method_ = method; 480 method_ = method;
479 } 481 }
480 482
481 void URLRequest::SetReferrer(const std::string& referrer) { 483 void URLRequest::SetReferrer(const std::string& referrer) {
482 DCHECK(!is_pending_); 484 DCHECK(!is_pending_);
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 out->clear(); 1225 out->clear();
1224 } 1226 }
1225 1227
1226 void URLRequest::set_status(URLRequestStatus status) { 1228 void URLRequest::set_status(URLRequestStatus status) {
1227 DCHECK(status_.is_io_pending() || status_.is_success() || 1229 DCHECK(status_.is_io_pending() || status_.is_success() ||
1228 (!status.is_success() && !status.is_io_pending())); 1230 (!status.is_success() && !status.is_io_pending()));
1229 status_ = status; 1231 status_ = status;
1230 } 1232 }
1231 1233
1232 } // namespace net 1234 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698