diff options
Diffstat (limited to 'net/base/cookie_monster.cc')
-rw-r--r-- | net/base/cookie_monster.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 86d71b8..f6d3a54 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -901,24 +901,17 @@ int CookieMonster::DeleteAllCreatedAfter(const Time& delete_begin, return DeleteAllCreatedBetween(delete_begin, Time(), sync_to_store); } -int CookieMonster::DeleteAllForHost(const GURL& url) { +int CookieMonster::DeleteAllForURL(const GURL& url, + bool sync_to_store) { AutoLock autolock(lock_); InitIfNecessary(); - if (!HasCookieableScheme(url)) - return 0; - - // We store host cookies in the store by their canonical host name; - // domain cookies are stored with a leading ".". So this is a pretty - // simple lookup and per-cookie delete. + CookieList cookies = InternalGetAllCookiesForURL(url); int num_deleted = 0; - for (CookieMapItPair its = cookies_.equal_range(url.host()); - its.first != its.second;) { - CookieMap::iterator curit = its.first; - ++its.first; - num_deleted++; - - InternalDeleteCookie(curit, true, kDeleteCookieExplicit); + for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) { + CookieMap::iterator curit = it; + ++it; + InternalDeleteCookie(curit, sync_to_store, kDeleteCookieExplicit); } return num_deleted; } |