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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 // Copy the CanonicalCookie pointers from the map so that we can use the same | 1092 // Copy the CanonicalCookie pointers from the map so that we can use the same |
1093 // sorter as elsewhere, then copy the result out. | 1093 // sorter as elsewhere, then copy the result out. |
1094 std::vector<CanonicalCookie*> cookie_ptrs; | 1094 std::vector<CanonicalCookie*> cookie_ptrs; |
1095 cookie_ptrs.reserve(cookies_.size()); | 1095 cookie_ptrs.reserve(cookies_.size()); |
1096 for (const auto& cookie : cookies_) | 1096 for (const auto& cookie : cookies_) |
1097 cookie_ptrs.push_back(cookie.second.get()); | 1097 cookie_ptrs.push_back(cookie.second.get()); |
1098 std::sort(cookie_ptrs.begin(), cookie_ptrs.end(), CookieSorter); | 1098 std::sort(cookie_ptrs.begin(), cookie_ptrs.end(), CookieSorter); |
1099 | 1099 |
1100 CookieList cookie_list; | 1100 CookieList cookie_list; |
1101 cookie_list.reserve(cookie_ptrs.size()); | 1101 cookie_list.reserve(cookie_ptrs.size()); |
1102 for (const auto& cookie_ptr : cookie_ptrs) | 1102 for (auto* cookie_ptr : cookie_ptrs) |
1103 cookie_list.push_back(*cookie_ptr); | 1103 cookie_list.push_back(*cookie_ptr); |
1104 | 1104 |
1105 return cookie_list; | 1105 return cookie_list; |
1106 } | 1106 } |
1107 | 1107 |
1108 CookieList CookieMonster::GetCookieListWithOptions( | 1108 CookieList CookieMonster::GetCookieListWithOptions( |
1109 const GURL& url, | 1109 const GURL& url, |
1110 const CookieOptions& options) { | 1110 const CookieOptions& options) { |
1111 DCHECK(thread_checker_.CalledOnValidThread()); | 1111 DCHECK(thread_checker_.CalledOnValidThread()); |
1112 | 1112 |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 it != hook_map_.end(); ++it) { | 2368 it != hook_map_.end(); ++it) { |
2369 std::pair<GURL, std::string> key = it->first; | 2369 std::pair<GURL, std::string> key = it->first; |
2370 if (cookie.IncludeForRequestURL(key.first, opts) && | 2370 if (cookie.IncludeForRequestURL(key.first, opts) && |
2371 cookie.Name() == key.second) { | 2371 cookie.Name() == key.second) { |
2372 it->second->Notify(cookie, cause); | 2372 it->second->Notify(cookie, cause); |
2373 } | 2373 } |
2374 } | 2374 } |
2375 } | 2375 } |
2376 | 2376 |
2377 } // namespace net | 2377 } // namespace net |
OLD | NEW |