Chromium Code Reviews| 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 // Portions of this code based on Mozilla: | 5 // Portions of this code based on Mozilla: |
| 6 // (netwerk/cookie/src/nsCookieService.cpp) | 6 // (netwerk/cookie/src/nsCookieService.cpp) |
| 7 /* ***** BEGIN LICENSE BLOCK ***** | 7 /* ***** BEGIN LICENSE BLOCK ***** |
| 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 9 * | 9 * |
| 10 * The contents of this file are subject to the Mozilla Public License Version | 10 * The contents of this file are subject to the Mozilla Public License Version |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 if (IsSecure() && !url.SchemeIsCryptographic()) | 384 if (IsSecure() && !url.SchemeIsCryptographic()) |
| 385 return false; | 385 return false; |
| 386 // Don't include cookies for requests that don't apply to the cookie domain. | 386 // Don't include cookies for requests that don't apply to the cookie domain. |
| 387 if (!IsDomainMatch(url.host())) | 387 if (!IsDomainMatch(url.host())) |
| 388 return false; | 388 return false; |
| 389 // Don't include cookies for requests with a url path that does not path | 389 // Don't include cookies for requests with a url path that does not path |
| 390 // match the cookie-path. | 390 // match the cookie-path. |
| 391 if (!IsOnPath(url.path())) | 391 if (!IsOnPath(url.path())) |
| 392 return false; | 392 return false; |
| 393 | 393 |
| 394 // Include first-party-only cookies iff |options| tells us to include all of | 394 // Include first-party-only cookies if: |
| 395 // them, or if a first-party URL is set and its origin matches the origin of | 395 // |
| 396 // |url|. | 396 // * |options| tells us to include all of them |
| 397 // * a first-party origin is set, and they matches the origin of |url| | |
| 397 if (IsFirstPartyOnly() && !options.include_first_party_only() && | 398 if (IsFirstPartyOnly() && !options.include_first_party_only() && |
|
mmenke
2015/10/16 17:29:26
Wait....We're more restrictive when options.includ
Mike West
2015/10/16 18:57:08
No? If `include_first_party_only` is set, we skip
mmenke
2015/10/16 19:02:09
Right...So "include_first_party_only()" is set, we
| |
| 398 options.first_party_url().GetOrigin() != url.GetOrigin()) { | 399 !options.first_party().IsSameOriginWith(url::Origin(url.GetOrigin()))) { |
|
mmenke
2015/10/16 17:29:26
I don't think GetOrigin() is needed here? It's no
Mike West
2015/10/16 18:57:08
Yeah. I should have dropped it.
| |
| 399 return false; | 400 return false; |
| 400 } | 401 } |
| 401 | 402 |
| 402 return true; | 403 return true; |
| 403 } | 404 } |
| 404 | 405 |
| 405 std::string CanonicalCookie::DebugString() const { | 406 std::string CanonicalCookie::DebugString() const { |
| 406 return base::StringPrintf( | 407 return base::StringPrintf( |
| 407 "name: %s value: %s domain: %s path: %s creation: %" | 408 "name: %s value: %s domain: %s path: %s creation: %" |
| 408 PRId64, | 409 PRId64, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 440 if (IsSecure() != other.IsSecure()) | 441 if (IsSecure() != other.IsSecure()) |
| 441 return IsSecure(); | 442 return IsSecure(); |
| 442 | 443 |
| 443 if (IsHttpOnly() != other.IsHttpOnly()) | 444 if (IsHttpOnly() != other.IsHttpOnly()) |
| 444 return IsHttpOnly(); | 445 return IsHttpOnly(); |
| 445 | 446 |
| 446 return Priority() < other.Priority(); | 447 return Priority() < other.Priority(); |
| 447 } | 448 } |
| 448 | 449 |
| 449 } // namespace net | 450 } // namespace net |
| OLD | NEW |