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

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

Issue 49019: Make sure last_seen_time_ is protected by the CookieMonster lock. (Closed)
Patch Set: Created 11 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 bool CookieMonster::SetCookie(const GURL& url, 383 bool CookieMonster::SetCookie(const GURL& url,
384 const std::string& cookie_line) { 384 const std::string& cookie_line) {
385 CookieOptions options; 385 CookieOptions options;
386 return SetCookieWithOptions(url, cookie_line, options); 386 return SetCookieWithOptions(url, cookie_line, options);
387 } 387 }
388 388
389 bool CookieMonster::SetCookieWithOptions(const GURL& url, 389 bool CookieMonster::SetCookieWithOptions(const GURL& url,
390 const std::string& cookie_line, 390 const std::string& cookie_line,
391 const CookieOptions& options) { 391 const CookieOptions& options) {
392 Time creation_date = CurrentTime(); 392 Time creation_date;
393 last_time_seen_ = creation_date; 393 {
394 AutoLock autolock(lock_);
395 creation_date = CurrentTime();
darin (slow to review) 2009/03/24 19:58:24 hmm... why call CurrentTime() from within the lock
396 last_time_seen_ = creation_date;
397 }
394 return SetCookieWithCreationTimeWithOptions(url, 398 return SetCookieWithCreationTimeWithOptions(url,
395 cookie_line, 399 cookie_line,
396 creation_date, 400 creation_date,
397 options); 401 options);
398 } 402 }
399 403
400 bool CookieMonster::SetCookieWithCreationTime(const GURL& url, 404 bool CookieMonster::SetCookieWithCreationTime(const GURL& url,
401 const std::string& cookie_line, 405 const std::string& cookie_line,
402 const Time& creation_time) { 406 const Time& creation_time) {
403 CookieOptions options; 407 CookieOptions options;
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 return true; 1115 return true;
1112 } 1116 }
1113 1117
1114 std::string CookieMonster::CanonicalCookie::DebugString() const { 1118 std::string CookieMonster::CanonicalCookie::DebugString() const {
1115 return StringPrintf("name: %s value: %s path: %s creation: %llu", 1119 return StringPrintf("name: %s value: %s path: %s creation: %llu",
1116 name_.c_str(), value_.c_str(), path_.c_str(), 1120 name_.c_str(), value_.c_str(), path_.c_str(),
1117 creation_date_.ToTimeT()); 1121 creation_date_.ToTimeT());
1118 } 1122 }
1119 1123
1120 } // namespace 1124 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698