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

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

Issue 1411813003: Teach URLRequest about initiator checks for First-Party-Only cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 4 years, 11 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 DCHECK(!is_pending_); 467 DCHECK(!is_pending_);
468 first_party_for_cookies_ = first_party_for_cookies; 468 first_party_for_cookies_ = first_party_for_cookies;
469 } 469 }
470 470
471 void URLRequest::set_first_party_url_policy( 471 void URLRequest::set_first_party_url_policy(
472 FirstPartyURLPolicy first_party_url_policy) { 472 FirstPartyURLPolicy first_party_url_policy) {
473 DCHECK(!is_pending_); 473 DCHECK(!is_pending_);
474 first_party_url_policy_ = first_party_url_policy; 474 first_party_url_policy_ = first_party_url_policy;
475 } 475 }
476 476
477 void URLRequest::set_initiator(const url::Origin& initiator) {
478 DCHECK(!is_pending_);
479 initiator_ = initiator;
480 }
481
477 void URLRequest::set_method(const std::string& method) { 482 void URLRequest::set_method(const std::string& method) {
478 DCHECK(!is_pending_); 483 DCHECK(!is_pending_);
479 method_ = method; 484 method_ = method;
480 } 485 }
481 486
482 void URLRequest::SetReferrer(const std::string& referrer) { 487 void URLRequest::SetReferrer(const std::string& referrer) {
483 DCHECK(!is_pending_); 488 DCHECK(!is_pending_);
484 GURL referrer_url(referrer); 489 GURL referrer_url(referrer);
485 if (referrer_url.is_valid()) { 490 if (referrer_url.is_valid()) {
486 referrer_ = referrer_url.GetAsReferrer().spec(); 491 referrer_ = referrer_url.GetAsReferrer().spec();
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 } 1226 }
1222 1227
1223 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { 1228 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const {
1224 if (job_) 1229 if (job_)
1225 job_->GetConnectionAttempts(out); 1230 job_->GetConnectionAttempts(out);
1226 else 1231 else
1227 out->clear(); 1232 out->clear();
1228 } 1233 }
1229 1234
1230 } // namespace net 1235 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698