diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-10 21:04:06 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-10 21:04:06 +0000 |
commit | 82388663bfbeb4dc2fc58e86f83505e67b483d31 (patch) | |
tree | f6dc5ed6116470917177b4883b1d07966d96b0ef /net/base/cookie_monster.cc | |
parent | 4a06deb64b754f0367e090229e1fe987cfb1d38a (diff) | |
download | chromium_src-82388663bfbeb4dc2fc58e86f83505e67b483d31.zip chromium_src-82388663bfbeb4dc2fc58e86f83505e67b483d31.tar.gz chromium_src-82388663bfbeb4dc2fc58e86f83505e67b483d31.tar.bz2 |
Added new checks:
+ ValidateMap() from DeleteAll() calling location in TabSpecificContentSettings.
+ Boolean to assert if ValidateMap() is called after destruction.
+ Hack to figure out if pre-rendering is happening in crashes.
BUG=74585
TEST=Try bots, running net_unittests CookieMonsterTest and unit_tests TabSpecificContentSettingsTest.
Review URL: http://codereview.chromium.org/6658039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/cookie_monster.cc')
-rw-r--r-- | net/base/cookie_monster.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index ef2653b..44204b5 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -65,6 +65,8 @@ using base::TimeDelta; using base::TimeTicks; static const int kMinutesInTenYears = 10 * 365 * 24 * 60; +static const int kMonsterAlive = 0xBBEEEEFF; +static const int kMonsterDead = 0xFFEEEEDD; namespace net { @@ -358,7 +360,8 @@ CookieMonster::CookieMonster(PersistentCookieStore* store, Delegate* delegate) last_access_threshold_( TimeDelta::FromSeconds(kDefaultAccessUpdateThresholdSeconds)), delegate_(delegate), - last_statistic_record_time_(Time::Now()) { + last_statistic_record_time_(Time::Now()), + monster_alive_(kMonsterAlive) { InitializeHistograms(); SetDefaultCookieableSchemes(); } @@ -372,7 +375,8 @@ CookieMonster::CookieMonster(PersistentCookieStore* store, last_access_threshold_(base::TimeDelta::FromMilliseconds( last_access_threshold_milliseconds)), delegate_(delegate), - last_statistic_record_time_(base::Time::Now()) { + last_statistic_record_time_(base::Time::Now()), + monster_alive_(kMonsterAlive) { InitializeHistograms(); SetDefaultCookieableSchemes(); } @@ -799,16 +803,20 @@ CookieMonster* CookieMonster::GetCookieMonster() { return this; } -void CookieMonster::ValidateMap() { +void CookieMonster::ValidateMap(int arg) { base::AutoLock autolock(lock_); // Skipping InitIfNecessary() to allow validation before first use. + CHECK_EQ(kMonsterAlive, monster_alive_); for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end(); ++it) CHECK(it->second); + // Keep routine from optimizing away. + VLOG(1) << "ValidateMap arg was " << arg; } CookieMonster::~CookieMonster() { DeleteAll(false); + monster_alive_ = kMonsterDead; } bool CookieMonster::SetCookieWithCreationTime(const GURL& url, |