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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 bool enforce_strict_secure, | 1146 bool enforce_strict_secure, |
1147 CookiePriority priority) { | 1147 CookiePriority priority) { |
1148 base::AutoLock autolock(lock_); | 1148 base::AutoLock autolock(lock_); |
1149 | 1149 |
1150 if (!HasCookieableScheme(url)) | 1150 if (!HasCookieableScheme(url)) |
1151 return false; | 1151 return false; |
1152 | 1152 |
1153 Time creation_time = CurrentTime(); | 1153 Time creation_time = CurrentTime(); |
1154 last_time_seen_ = creation_time; | 1154 last_time_seen_ = creation_time; |
1155 | 1155 |
1156 scoped_ptr<CanonicalCookie> cc; | 1156 scoped_ptr<CanonicalCookie> cc(CanonicalCookie::Create( |
1157 cc.reset(CanonicalCookie::Create( | |
1158 url, name, value, domain, path, creation_time, expiration_time, secure, | 1157 url, name, value, domain, path, creation_time, expiration_time, secure, |
1159 http_only, first_party_only, enforce_strict_secure, priority)); | 1158 http_only, first_party_only, enforce_strict_secure, priority)); |
1160 | 1159 |
1161 if (!cc.get()) | 1160 if (!cc.get()) |
1162 return false; | 1161 return false; |
1163 | 1162 |
1164 CookieOptions options; | 1163 CookieOptions options; |
1165 options.set_include_httponly(); | 1164 options.set_include_httponly(); |
1166 options.set_include_first_party_only_cookies(); | 1165 options.set_include_first_party_only_cookies(); |
1167 if (enforce_strict_secure) | 1166 if (enforce_strict_secure) |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 it != hook_map_.end(); ++it) { | 2493 it != hook_map_.end(); ++it) { |
2495 std::pair<GURL, std::string> key = it->first; | 2494 std::pair<GURL, std::string> key = it->first; |
2496 if (cookie.IncludeForRequestURL(key.first, opts) && | 2495 if (cookie.IncludeForRequestURL(key.first, opts) && |
2497 cookie.Name() == key.second) { | 2496 cookie.Name() == key.second) { |
2498 it->second->Notify(cookie, removed); | 2497 it->second->Notify(cookie, removed); |
2499 } | 2498 } |
2500 } | 2499 } |
2501 } | 2500 } |
2502 | 2501 |
2503 } // namespace net | 2502 } // namespace net |
OLD | NEW |