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

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

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Rewrite using base::Optional 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_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 initiator_ = initiator; 473 initiator_ = initiator;
474 } 474 }
475 475
476 void URLRequest::set_method(const std::string& method) { 476 void URLRequest::set_method(const std::string& method) {
477 DCHECK(!is_pending_); 477 DCHECK(!is_pending_);
478 method_ = method; 478 method_ = method;
479 } 479 }
480 480
481 void URLRequest::SetReferrer(const std::string& referrer) { 481 void URLRequest::SetReferrer(const std::string& referrer) {
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 out->clear(); 1224 out->clear();
1225 } 1225 }
1226 1226
1227 void URLRequest::set_status(URLRequestStatus status) { 1227 void URLRequest::set_status(URLRequestStatus status) {
1228 DCHECK(status_.is_io_pending() || status_.is_success() || 1228 DCHECK(status_.is_io_pending() || status_.is_success() ||
1229 (!status.is_success() && !status.is_io_pending())); 1229 (!status.is_success() && !status.is_io_pending()));
1230 status_ = status; 1230 status_ = status;
1231 } 1231 }
1232 1232
1233 } // namespace net 1233 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698