Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: net/cookies/canonical_cookie.cc

Issue 1414603010: Treat exact domain match cookies on public suffixes as host cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return NULL; 228 return NULL;
229 } 229 }
230 230
231 if (options.exclude_httponly() && parsed_cookie.IsHttpOnly()) { 231 if (options.exclude_httponly() && parsed_cookie.IsHttpOnly()) {
232 VLOG(kVlogSetCookies) << "Create() is not creating a httponly cookie"; 232 VLOG(kVlogSetCookies) << "Create() is not creating a httponly cookie";
233 return NULL; 233 return NULL;
234 } 234 }
235 235
236 std::string cookie_domain; 236 std::string cookie_domain;
237 if (!GetCookieDomain(url, parsed_cookie, &cookie_domain)) { 237 if (!GetCookieDomain(url, parsed_cookie, &cookie_domain)) {
238 VLOG(kVlogSetCookies) << "Create() failed to get a cookie domain";
238 return NULL; 239 return NULL;
239 } 240 }
240 241
241 std::string cookie_path = CanonicalCookie::CanonPath(url, parsed_cookie); 242 std::string cookie_path = CanonicalCookie::CanonPath(url, parsed_cookie);
242 Time server_time(creation_time); 243 Time server_time(creation_time);
243 if (options.has_server_time()) 244 if (options.has_server_time())
244 server_time = options.server_time(); 245 server_time = options.server_time();
245 246
246 Time cookie_expires = CanonicalCookie::CanonExpiration(parsed_cookie, 247 Time cookie_expires = CanonicalCookie::CanonExpiration(parsed_cookie,
247 creation_time, 248 creation_time,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (IsSecure() != other.IsSecure()) 442 if (IsSecure() != other.IsSecure())
442 return IsSecure(); 443 return IsSecure();
443 444
444 if (IsHttpOnly() != other.IsHttpOnly()) 445 if (IsHttpOnly() != other.IsHttpOnly())
445 return IsHttpOnly(); 446 return IsHttpOnly();
446 447
447 return Priority() < other.Priority(); 448 return Priority() < other.Priority();
448 } 449 }
449 450
450 } // namespace net 451 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698