Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: net/cookies/cookie_monster.cc

Issue 1766613002: Revert of Replace std::string::find with base::StartsWith when comparing cookie paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster.cc
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index b62f635b52f63e456c14600970317f660ca2814a..e9eccd2c907f94a20025d4a5dc6925105db46d2c 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -1211,12 +1211,13 @@
FindCookiesForHostAndDomain(url, options, &cookies);
std::set<CanonicalCookie*> matching_cookies;
- for (const auto& cookie : cookies) {
- if (cookie->Name() != cookie_name)
+ for (std::vector<CanonicalCookie*>::const_iterator it = cookies.begin();
+ it != cookies.end(); ++it) {
+ if ((*it)->Name() != cookie_name)
continue;
- if (!cookie->IsOnPath(url.path()))
+ if (url.path().find((*it)->Path()))
continue;
- matching_cookies.insert(cookie);
+ matching_cookies.insert(*it);
}
for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) {
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698