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

Side by Side Diff: net/base/cookie_monster.cc

Issue 6995013: More progress towards removing content settings code from the content layer. We can't use Cookie... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix net_unittests Created 9 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Invalid or no expiration, persistent cookie. 298 // Invalid or no expiration, persistent cookie.
299 return Time(); 299 return Time();
300 } 300 }
301 301
302 Time CanonExpiration(const CookieMonster::ParsedCookie& pc, 302 Time CanonExpiration(const CookieMonster::ParsedCookie& pc,
303 const Time& current, 303 const Time& current,
304 const CookieOptions& options) { 304 const CookieOptions& options) {
305 Time expiration_time = CanonExpirationInternal(pc, current); 305 Time expiration_time = CanonExpirationInternal(pc, current);
306 306
307 if (options.force_session()) { 307 if (options.force_session()) {
308 // Only override the expiry adte if it's in the future. If the expiry date 308 // Only override the expiry date if it's in the future. If the expiry date
309 // is before the creation date, the cookie is supposed to be deleted. 309 // is before the creation date, the cookie is supposed to be deleted.
310 if (expiration_time.is_null() || expiration_time > current) 310 if (expiration_time.is_null() || expiration_time > current)
311 return Time(); 311 return Time();
312 } 312 }
313 313
314 return expiration_time; 314 return expiration_time;
315 } 315 }
316 316
317 // Helper for GarbageCollection. If |cookie_its->size() > num_max|, remove the 317 // Helper for GarbageCollection. If |cookie_its->size() > num_max|, remove the
318 // |num_max - num_purge| most recently accessed cookies from cookie_its. 318 // |num_max - num_purge| most recently accessed cookies from cookie_its.
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 std::string CookieMonster::CanonicalCookie::DebugString() const { 2124 std::string CookieMonster::CanonicalCookie::DebugString() const {
2125 return base::StringPrintf( 2125 return base::StringPrintf(
2126 "name: %s value: %s domain: %s path: %s creation: %" 2126 "name: %s value: %s domain: %s path: %s creation: %"
2127 PRId64, 2127 PRId64,
2128 name_.c_str(), value_.c_str(), 2128 name_.c_str(), value_.c_str(),
2129 domain_.c_str(), path_.c_str(), 2129 domain_.c_str(), path_.c_str(),
2130 static_cast<int64>(creation_date_.ToTimeT())); 2130 static_cast<int64>(creation_date_.ToTimeT()));
2131 } 2131 }
2132 2132
2133 } // namespace 2133 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698