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

Unified Diff: net/cookies/canonical_cookie.h

Issue 2898953008: Implement and test CanonicalCookie::IsCanonical() (Closed)
Patch Set: Removed vestigial code. Created 3 years, 6 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 | « ios/net/cookies/cookie_store_ios_unittest.mm ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/canonical_cookie.h
diff --git a/net/cookies/canonical_cookie.h b/net/cookies/canonical_cookie.h
index a2b366ddd619724ffe63c3750db0077aeead6b00..1d3b3ed5337debcdfef591bfa54837bef56fdbe4 100644
--- a/net/cookies/canonical_cookie.h
+++ b/net/cookies/canonical_cookie.h
@@ -144,6 +144,21 @@ class NET_EXPORT CanonicalCookie {
// FullCompare() are also sorted with respect to PartialCompare().
bool FullCompare(const CanonicalCookie& other) const;
+ // Return whether this object is a valid CanonicalCookie(). Invalid
+ // cookies may be constructed by the detailed constructor.
+ // A cookie is considered canonical if-and-only-if:
+ // * It can be created by CanonicalCookie::Create, or
+ // * It is identical to a cookie created by CanonicalCookie::Create except
+ // that the creation time is null, or
+ // * It can be derived from a cookie created by CanonicalCookie::Create by
+ // entry into and retrieval from a cookie store (specifically, this means
+ // by the setting of an creation time in place of a null creation time, and
+ // the setting of a last access time).
+ // An additional requirement on a CanonicalCookie is that if the last
+ // access time is non-null, the creation time must also be non-null and
+ // greater than the last access time.
+ bool IsCanonical() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(CanonicalCookieTest, TestPrefixHistograms);
« no previous file with comments | « ios/net/cookies/cookie_store_ios_unittest.mm ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698