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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster.cc
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index 2f0d4b44c259c173404d9f0e8cec31d5b92a44c4..4b5d8e039b1ddc7174b566975cbbe1edfa938b28 100644
--- a/net/base/cookie_monster.cc
+++ b/net/base/cookie_monster.cc
@@ -389,8 +389,12 @@ bool CookieMonster::SetCookie(const GURL& url,
bool CookieMonster::SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
const CookieOptions& options) {
- Time creation_date = CurrentTime();
- last_time_seen_ = creation_date;
+ Time creation_date;
+ {
+ AutoLock autolock(lock_);
+ creation_date = CurrentTime();
darin (slow to review) 2009/03/24 19:58:24 hmm... why call CurrentTime() from within the lock
+ last_time_seen_ = creation_date;
+ }
return SetCookieWithCreationTimeWithOptions(url,
cookie_line,
creation_date,
« 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