Index: net/base/cookie_monster.h |
=================================================================== |
--- net/base/cookie_monster.h (revision 65294) |
+++ net/base/cookie_monster.h (working copy) |
@@ -159,7 +159,7 @@ |
const std::string& domain, |
const std::string& path, |
const base::Time& expiration_time, |
- bool secure, bool http_only); |
+ bool secure, bool http_only, bool origin); |
// Returns all the cookies, for use in management UI, etc. This does not mark |
// the cookies as having been accessed. |
@@ -487,6 +487,7 @@ |
const std::string& path, |
bool secure, |
bool httponly, |
+ bool origin, |
const base::Time& creation, |
const base::Time& last_access, |
bool has_expires, |
@@ -508,7 +509,7 @@ |
const GURL& url, const std::string& name, const std::string& value, |
const std::string& domain, const std::string& path, |
const base::Time& creation_time, const base::Time& expiration_time, |
- bool secure, bool http_only); |
+ bool secure, bool http_only, bool origin); |
const std::string& Name() const { return name_; } |
const std::string& Value() const { return value_; } |
@@ -521,6 +522,7 @@ |
const base::Time& ExpiryDate() const { return expiry_date_; } |
bool IsSecure() const { return secure_; } |
bool IsHttpOnly() const { return httponly_; } |
+ bool IsOrigin() const { return origin_; } |
bool IsDomainCookie() const { |
return !domain_.empty() && domain_[0] == '.'; } |
bool IsHostCookie() const { return !IsDomainCookie(); } |
@@ -536,11 +538,13 @@ |
// having been canonicalized (in |
// GetCookieDomainWithString->CanonicalizeHost). |
bool IsEquivalent(const CanonicalCookie& ecc) const { |
- // It seems like it would make sense to take secure and httponly into |
- // account, but the RFC doesn't specify this. |
- // NOTE: Keep this logic in-sync with TrimDuplicateCookiesForHost(). |
- return (name_ == ecc.Name() && domain_ == ecc.Domain() |
- && path_ == ecc.Path()); |
+ if (origin_ != ecc.IsOrigin()) |
+ return false; |
+ if (origin_ && secure_ != ecc.IsSecure()) |
+ return false; |
+ return (name_ == ecc.Name() && |
+ domain_ == ecc.Domain() && |
+ path_ == ecc.Path()); |
} |
void SetLastAccessDate(const base::Time& date) { |
@@ -562,6 +566,7 @@ |
bool has_expires_; |
bool secure_; |
bool httponly_; |
+ bool origin_; |
}; |
class CookieMonster::Delegate |
@@ -608,6 +613,7 @@ |
const std::string& MaxAge() const { return pairs_[maxage_index_].second; } |
bool IsSecure() const { return secure_index_ != 0; } |
bool IsHttpOnly() const { return httponly_index_ != 0; } |
+ bool IsOrigin() const { return origin_index_ != 0; } |
// Returns the number of attributes, for example, returning 2 for: |
// "BLAH=hah; path=/; domain=.google.com" |
@@ -666,6 +672,7 @@ |
size_t maxage_index_; |
size_t secure_index_; |
size_t httponly_index_; |
+ size_t origin_index_; |
DISALLOW_COPY_AND_ASSIGN(ParsedCookie); |
}; |