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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 return a.Path().compare(b.Path()); | 118 return a.Path().compare(b.Path()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace | 121 } // namespace |
| 122 | 122 |
| 123 CanonicalCookie::CanonicalCookie() | 123 CanonicalCookie::CanonicalCookie() |
| 124 : secure_(false), | 124 : secure_(false), |
| 125 httponly_(false) { | 125 httponly_(false) { |
| 126 } | 126 } |
| 127 | 127 |
| 128 CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default; | |
| 129 | |
| 130 CanonicalCookie::~CanonicalCookie() {} | |
| 131 | |
| 128 CanonicalCookie::CanonicalCookie(const GURL& url, | 132 CanonicalCookie::CanonicalCookie(const GURL& url, |
|
mmenke
2016/07/21 15:34:57
nit: This should be moved down below FullCompare,
tfarina
2016/07/21 19:05:41
Done.
tfarina
2016/07/21 19:05:41
Looks like CanonPath is not at the right place eit
| |
| 129 const std::string& name, | 133 const std::string& name, |
| 130 const std::string& value, | 134 const std::string& value, |
| 131 const std::string& domain, | 135 const std::string& domain, |
| 132 const std::string& path, | 136 const std::string& path, |
| 133 const base::Time& creation, | 137 const base::Time& creation, |
| 134 const base::Time& expiration, | 138 const base::Time& expiration, |
| 135 const base::Time& last_access, | 139 const base::Time& last_access, |
| 136 bool secure, | 140 bool secure, |
| 137 bool httponly, | 141 bool httponly, |
| 138 CookieSameSite same_site, | 142 CookieSameSite same_site, |
| 139 CookiePriority priority) | 143 CookiePriority priority) |
| 140 : name_(name), | 144 : name_(name), |
| 141 value_(value), | 145 value_(value), |
| 142 domain_(domain), | 146 domain_(domain), |
| 143 path_(path), | 147 path_(path), |
| 144 creation_date_(creation), | 148 creation_date_(creation), |
| 145 expiry_date_(expiration), | 149 expiry_date_(expiration), |
| 146 last_access_date_(last_access), | 150 last_access_date_(last_access), |
| 147 secure_(secure), | 151 secure_(secure), |
| 148 httponly_(httponly), | 152 httponly_(httponly), |
| 149 same_site_(same_site), | 153 same_site_(same_site), |
| 150 priority_(priority) {} | 154 priority_(priority) {} |
| 151 | 155 |
| 152 CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default; | |
| 153 | |
| 154 CanonicalCookie::~CanonicalCookie() { | |
| 155 } | |
| 156 | |
| 157 // static | 156 // static |
| 158 std::string CanonicalCookie::CanonPath(const GURL& url, | 157 std::string CanonicalCookie::CanonPath(const GURL& url, |
| 159 const ParsedCookie& pc) { | 158 const ParsedCookie& pc) { |
| 160 std::string path_string; | 159 std::string path_string; |
| 161 if (pc.HasPath()) | 160 if (pc.HasPath()) |
| 162 path_string = pc.Path(); | 161 path_string = pc.Path(); |
| 163 return CanonPathWithString(url, path_string); | 162 return CanonPathWithString(url, path_string); |
| 164 } | 163 } |
| 165 | 164 |
| 166 // static | 165 // static |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 return true; | 522 return true; |
| 524 } | 523 } |
| 525 | 524 |
| 526 std::string CanonicalCookie::DomainWithoutDot() const { | 525 std::string CanonicalCookie::DomainWithoutDot() const { |
| 527 if (domain_.empty() || domain_[0] != '.') | 526 if (domain_.empty() || domain_[0] != '.') |
| 528 return domain_; | 527 return domain_; |
| 529 return domain_.substr(1); | 528 return domain_.substr(1); |
| 530 } | 529 } |
| 531 | 530 |
| 532 } // namespace net | 531 } // namespace net |
| OLD | NEW |