| 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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 | 1216 |
| 1217 CookieOptions options; | 1217 CookieOptions options; |
| 1218 options.set_include_httponly(); | 1218 options.set_include_httponly(); |
| 1219 options.set_same_site_cookie_mode( | 1219 options.set_same_site_cookie_mode( |
| 1220 CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX); | 1220 CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX); |
| 1221 // Get the cookies for this host and its domain(s). | 1221 // Get the cookies for this host and its domain(s). |
| 1222 std::vector<CanonicalCookie*> cookies; | 1222 std::vector<CanonicalCookie*> cookies; |
| 1223 FindCookiesForHostAndDomain(url, options, &cookies); | 1223 FindCookiesForHostAndDomain(url, options, &cookies); |
| 1224 std::set<CanonicalCookie*> matching_cookies; | 1224 std::set<CanonicalCookie*> matching_cookies; |
| 1225 | 1225 |
| 1226 for (const auto& cookie : cookies) { | 1226 for (auto* cookie : cookies) { |
| 1227 if (cookie->Name() != cookie_name) | 1227 if (cookie->Name() != cookie_name) |
| 1228 continue; | 1228 continue; |
| 1229 if (!cookie->IsOnPath(url.path())) | 1229 if (!cookie->IsOnPath(url.path())) |
| 1230 continue; | 1230 continue; |
| 1231 matching_cookies.insert(cookie); | 1231 matching_cookies.insert(cookie); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) { | 1234 for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) { |
| 1235 CookieMap::iterator curit = it; | 1235 CookieMap::iterator curit = it; |
| 1236 ++it; | 1236 ++it; |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2394 it != hook_map_.end(); ++it) { | 2394 it != hook_map_.end(); ++it) { |
| 2395 std::pair<GURL, std::string> key = it->first; | 2395 std::pair<GURL, std::string> key = it->first; |
| 2396 if (cookie.IncludeForRequestURL(key.first, opts) && | 2396 if (cookie.IncludeForRequestURL(key.first, opts) && |
| 2397 cookie.Name() == key.second) { | 2397 cookie.Name() == key.second) { |
| 2398 it->second->Notify(cookie, removed); | 2398 it->second->Notify(cookie, removed); |
| 2399 } | 2399 } |
| 2400 } | 2400 } |
| 2401 } | 2401 } |
| 2402 | 2402 |
| 2403 } // namespace net | 2403 } // namespace net |
| OLD | NEW |