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 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 } | 1800 } |
1801 | 1801 |
1802 bool CookieMonster::SetCanonicalCookies(const CookieList& list) { | 1802 bool CookieMonster::SetCanonicalCookies(const CookieList& list) { |
1803 DCHECK(thread_checker_.CalledOnValidThread()); | 1803 DCHECK(thread_checker_.CalledOnValidThread()); |
1804 | 1804 |
1805 CookieOptions options; | 1805 CookieOptions options; |
1806 options.set_include_httponly(); | 1806 options.set_include_httponly(); |
1807 | 1807 |
1808 for (const auto& cookie : list) { | 1808 for (const auto& cookie : list) { |
1809 // Use an empty GURL. This method does not support setting secure cookies. | 1809 // Use an empty GURL. This method does not support setting secure cookies. |
1810 if (!SetCanonicalCookie(base::WrapUnique(new CanonicalCookie(cookie)), | 1810 if (!SetCanonicalCookie(base::MakeUnique<CanonicalCookie>(cookie), GURL(), |
1811 GURL(), options)) { | 1811 options)) { |
1812 return false; | 1812 return false; |
1813 } | 1813 } |
1814 } | 1814 } |
1815 | 1815 |
1816 return true; | 1816 return true; |
1817 } | 1817 } |
1818 | 1818 |
1819 void CookieMonster::InternalUpdateCookieAccessTime(CanonicalCookie* cc, | 1819 void CookieMonster::InternalUpdateCookieAccessTime(CanonicalCookie* cc, |
1820 const Time& current) { | 1820 const Time& current) { |
1821 DCHECK(thread_checker_.CalledOnValidThread()); | 1821 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 it != hook_map_.end(); ++it) { | 2390 it != hook_map_.end(); ++it) { |
2391 std::pair<GURL, std::string> key = it->first; | 2391 std::pair<GURL, std::string> key = it->first; |
2392 if (cookie.IncludeForRequestURL(key.first, opts) && | 2392 if (cookie.IncludeForRequestURL(key.first, opts) && |
2393 cookie.Name() == key.second) { | 2393 cookie.Name() == key.second) { |
2394 it->second->Notify(cookie, removed); | 2394 it->second->Notify(cookie, removed); |
2395 } | 2395 } |
2396 } | 2396 } |
2397 } | 2397 } |
2398 | 2398 |
2399 } // namespace net | 2399 } // namespace net |
OLD | NEW |