diff options
author | rdsmith@google.com <rdsmith@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 14:41:30 +0000 |
---|---|---|
committer | rdsmith@google.com <rdsmith@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 14:41:30 +0000 |
commit | cf12bd14cb9774d97bbe0865f47106cb6f1f9edb (patch) | |
tree | 711a7c8116fecf0e73036bbc81ebfc83bff64fde /net | |
parent | 5760db1c137ab907e01b307a9440fa3b114fa892 (diff) | |
download | chromium_src-cf12bd14cb9774d97bbe0865f47106cb6f1f9edb.zip chromium_src-cf12bd14cb9774d97bbe0865f47106cb6f1f9edb.tar.gz chromium_src-cf12bd14cb9774d97bbe0865f47106cb6f1f9edb.tar.bz2 |
Assert SetCookieableScheme called before first use.
BUG=44476
TEST=Linux CookieMonster.SetCookieableSchemes (as modified)
Review URL: http://codereview.chromium.org/2869002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rwxr-xr-x | net/base/cookie_monster.cc | 3 | ||||
-rw-r--r-- | net/base/cookie_monster.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 7e17906..fbc0877 100755 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -551,6 +551,9 @@ void CookieMonster::SetCookieableSchemes( const char* schemes[], size_t num_schemes) { AutoLock autolock(lock_); + // Cookieable Schemes must be set before first use of function. + DCHECK(!initialized_); + cookieable_schemes_.clear(); cookieable_schemes_.insert(cookieable_schemes_.end(), schemes, schemes + num_schemes); diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index ec9ca16..ee869e9 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -147,6 +147,8 @@ class CookieMonster : public CookieStore { // Override the default list of schemes that are allowed to be set in // this cookie store. Calling his overrides the value of // "enable_file_scheme_". + // If this this method is called, it must be called before first use of + // the instance (i.e. as part of the instance initialization process.) void SetCookieableSchemes(const char* schemes[], size_t num_schemes); // There are some unknowns about how to correctly handle file:// cookies, |