Chromium Code Reviews| Index: net/cookies/cookie_monster.cc |
| diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc |
| index e9eccd2c907f94a20025d4a5dc6925105db46d2c..b62f635b52f63e456c14600970317f660ca2814a 100644 |
| --- a/net/cookies/cookie_monster.cc |
| +++ b/net/cookies/cookie_monster.cc |
| @@ -1211,13 +1211,12 @@ void CookieMonster::DeleteCookie(const GURL& url, |
| FindCookiesForHostAndDomain(url, options, &cookies); |
| std::set<CanonicalCookie*> matching_cookies; |
| - for (std::vector<CanonicalCookie*>::const_iterator it = cookies.begin(); |
| - it != cookies.end(); ++it) { |
| - if ((*it)->Name() != cookie_name) |
| + for (const auto& cookie : cookies) { |
| + if (cookie->Name() != cookie_name) |
| continue; |
| - if (url.path().find((*it)->Path())) |
| + if (!cookie->IsOnPath(url.path())) |
|
mmenke
2016/03/02 20:02:01
Just happened to notice this bug when cleaning up
Mike West
2016/03/03 18:56:28
\o/
|
| continue; |
| - matching_cookies.insert(*it); |
| + matching_cookies.insert(cookie); |
| } |
| for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) { |