Chromium Code Reviews| Index: net/cookies/canonical_cookie.cc |
| diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc |
| index 83e0e6023f753015bea039c253ddee8d88d5495e..557755d209e4f2809607031c4e26c7cc5e8b2492 100644 |
| --- a/net/cookies/canonical_cookie.cc |
| +++ b/net/cookies/canonical_cookie.cc |
| @@ -371,6 +371,25 @@ bool CanonicalCookie::IsDomainMatch(const std::string& host) const { |
| domain_.length(), domain_) == 0); |
| } |
| +bool CanonicalCookie::IncludeForRequestURL(const GURL& url, |
| + const CookieOptions& options) const { |
| + // Filter out HttpOnly cookies, per options. |
| + if (options.exclude_httponly() && IsHttpOnly()) |
| + return false; |
| + // Secure cookies should not be included in requests for URLs with an |
| + // unsecure scheme. |
|
erikwright (departed)
2012/12/05 19:43:36
unsecure -> insecure
markusheintz_
2012/12/06 10:10:43
Done.
|
| + if (IsSecure() && !url.SchemeIsSecure()) |
| + return false; |
| + // Don't include cookies for requests that don't apply to the cookie domain. |
| + if (!IsDomainMatch(url.host())) |
| + return false; |
| + // Don't include cookies for requests that |
|
erikwright (departed)
2012/12/05 19:43:36
incomplete comment.
markusheintz_
2012/12/06 10:10:43
Done.
|
| + if (!IsOnPath(url.path())) |
| + return false; |
| + |
| + return true; |
| +} |
| + |
| std::string CanonicalCookie::DebugString() const { |
| return base::StringPrintf( |
| "name: %s value: %s domain: %s path: %s creation: %" |