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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 DCHECK(secure_cookie_its && non_secure_cookie_its); | 244 DCHECK(secure_cookie_its && non_secure_cookie_its); |
245 for (const auto& curit : cookie_its) { | 245 for (const auto& curit : cookie_its) { |
246 if (curit->second->IsSecure()) | 246 if (curit->second->IsSecure()) |
247 secure_cookie_its->push_back(curit); | 247 secure_cookie_its->push_back(curit); |
248 else | 248 else |
249 non_secure_cookie_its->push_back(curit); | 249 non_secure_cookie_its->push_back(curit); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 // Predicate to support PartitionCookieByPriority(). | 253 // Predicate to support PartitionCookieByPriority(). |
254 struct CookiePriorityEqualsTo | 254 struct CookiePriorityEqualsTo { |
255 : std::unary_function<const CookieMonster::CookieMap::iterator, bool> { | |
256 explicit CookiePriorityEqualsTo(CookiePriority priority) | 255 explicit CookiePriorityEqualsTo(CookiePriority priority) |
257 : priority_(priority) {} | 256 : priority_(priority) {} |
258 | 257 |
259 bool operator()(const CookieMonster::CookieMap::iterator it) const { | 258 bool operator()(const CookieMonster::CookieMap::iterator it) const { |
260 return it->second->Priority() == priority_; | 259 return it->second->Priority() == priority_; |
261 } | 260 } |
262 | 261 |
263 const CookiePriority priority_; | 262 const CookiePriority priority_; |
264 }; | 263 }; |
265 | 264 |
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2346 it != hook_map_.end(); ++it) { | 2345 it != hook_map_.end(); ++it) { |
2347 std::pair<GURL, std::string> key = it->first; | 2346 std::pair<GURL, std::string> key = it->first; |
2348 if (cookie.IncludeForRequestURL(key.first, opts) && | 2347 if (cookie.IncludeForRequestURL(key.first, opts) && |
2349 cookie.Name() == key.second) { | 2348 cookie.Name() == key.second) { |
2350 it->second->Notify(cookie, removed); | 2349 it->second->Notify(cookie, removed); |
2351 } | 2350 } |
2352 } | 2351 } |
2353 } | 2352 } |
2354 | 2353 |
2355 } // namespace net | 2354 } // namespace net |
OLD | NEW |