summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 12:12:25 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 12:12:25 +0000
commit49435ccdf622976494dd3dcbc6912994407febd1 (patch)
tree1c4fd024f42e2982eee1e9284452bf34170c826a /net
parent63a5c2a2b231a3dca148360d3acf3b6903de0363 (diff)
downloadchromium_src-49435ccdf622976494dd3dcbc6912994407febd1.zip
chromium_src-49435ccdf622976494dd3dcbc6912994407febd1.tar.gz
chromium_src-49435ccdf622976494dd3dcbc6912994407febd1.tar.bz2
Make sure last_time_seen_ is protected by the CookieMonster lock.
Review URL: http://codereview.chromium.org/49019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/cookie_monster.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index 2f0d4b4..4b5d8e0 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();
+ last_time_seen_ = creation_date;
+ }
return SetCookieWithCreationTimeWithOptions(url,
cookie_line,
creation_date,