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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 secure, http_only, priority)); | 1094 secure, http_only, priority)); |
1095 | 1095 |
1096 if (!cc.get()) | 1096 if (!cc.get()) |
1097 return false; | 1097 return false; |
1098 | 1098 |
1099 CookieOptions options; | 1099 CookieOptions options; |
1100 options.set_include_httponly(); | 1100 options.set_include_httponly(); |
1101 return SetCanonicalCookie(&cc, creation_time, options); | 1101 return SetCanonicalCookie(&cc, creation_time, options); |
1102 } | 1102 } |
1103 | 1103 |
1104 bool CookieMonster::InitializeFrom(const CookieList& list) { | 1104 bool CookieMonster::ImportCookies(const CookieList& list) { |
1105 base::AutoLock autolock(lock_); | 1105 base::AutoLock autolock(lock_); |
1106 InitIfNecessary(); | 1106 InitIfNecessary(); |
1107 for (net::CookieList::const_iterator iter = list.begin(); | 1107 for (net::CookieList::const_iterator iter = list.begin(); |
1108 iter != list.end(); ++iter) { | 1108 iter != list.end(); ++iter) { |
1109 scoped_ptr<CanonicalCookie> cookie(new CanonicalCookie(*iter)); | 1109 scoped_ptr<CanonicalCookie> cookie(new CanonicalCookie(*iter)); |
1110 net::CookieOptions options; | 1110 net::CookieOptions options; |
1111 options.set_include_httponly(); | 1111 options.set_include_httponly(); |
1112 if (!SetCanonicalCookie(&cookie, cookie->CreationDate(), options)) | 1112 if (!SetCanonicalCookie(&cookie, cookie->CreationDate(), options)) |
1113 return false; | 1113 return false; |
1114 } | 1114 } |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 | 2297 |
2298 return true; | 2298 return true; |
2299 } | 2299 } |
2300 | 2300 |
2301 bool CookieMonster::loaded() { | 2301 bool CookieMonster::loaded() { |
2302 base::AutoLock autolock(lock_); | 2302 base::AutoLock autolock(lock_); |
2303 return loaded_; | 2303 return loaded_; |
2304 } | 2304 } |
2305 | 2305 |
2306 } // namespace net | 2306 } // namespace net |
OLD | NEW |