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

Unified Diff: net/cookies/cookie_monster.cc

Issue 11308272: Add IncludeForRequestURL method to CanonicalCookie (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years 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_unittest.cc ('k') | no next file » | 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 3397628003a1795750a0f7db45b4ef399267c568..0285a55a4714a3b6c6993fb11a98d7b7081ccf83 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -1602,9 +1602,6 @@ void CookieMonster::FindCookiesForKey(
std::vector<CanonicalCookie*>* cookies) {
lock_.AssertAcquired();
- const std::string host(url.host());
- bool secure = url.SchemeIsSecure();
-
for (CookieMapItPair its = cookies_.equal_range(key);
its.first != its.second; ) {
CookieMap::iterator curit = its.first;
@@ -1617,22 +1614,13 @@ void CookieMonster::FindCookiesForKey(
continue;
}
- // Filter out HttpOnly cookies, per options.
- if (options.exclude_httponly() && cc->IsHttpOnly())
- continue;
-
- // Filter out secure cookies unless we're https.
- if (!secure && cc->IsSecure())
- continue;
-
- // Filter out cookies that don't apply to this domain.
- if (!cc->IsDomainMatch(host))
- continue;
-
- if (!cc->IsOnPath(url.path()))
+ // Filter out cookies that should not be included for a request to the
+ // given |url|. HTTP only cookies are filtered depending on the passed
+ // cookie |options|.
+ if (!cc->IncludeForRequestURL(url, options))
continue;
- // Add this cookie to the set of matching cookies. Update the access
+ // Add this cookie to the set of matching cookies. Update the access
// time if we've been requested to do so.
if (update_access_time) {
InternalUpdateCookieAccessTime(cc, current);
« no previous file with comments | « net/cookies/canonical_cookie_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698