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

Side by Side Diff: net/cookies/canonical_cookie.h

Issue 2882063002: Add a SetCanonicalCookie method for CookieMonster. (Closed)
Patch Set: Fix AW cookie store wrapper. 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 unified diff | Download patch
« no previous file with comments | « ios/net/cookies/cookie_store_ios_persistent.mm ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_COOKIES_CANONICAL_COOKIE_H_ 5 #ifndef NET_COOKIES_CANONICAL_COOKIE_H_
6 #define NET_COOKIES_CANONICAL_COOKIE_H_ 6 #define NET_COOKIES_CANONICAL_COOKIE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 29 matching lines...) Expand all
40 bool secure, 40 bool secure,
41 bool httponly, 41 bool httponly,
42 CookieSameSite same_site, 42 CookieSameSite same_site,
43 CookiePriority priority); 43 CookiePriority priority);
44 44
45 ~CanonicalCookie(); 45 ~CanonicalCookie();
46 46
47 // Supports the default copy constructor. 47 // Supports the default copy constructor.
48 48
49 // Creates a new |CanonicalCookie| from the |cookie_line| and the 49 // Creates a new |CanonicalCookie| from the |cookie_line| and the
50 // |creation_time|. Canonicalizes and validates inputs. May return NULL if 50 // |creation_time|. Canonicalizes and validates inputs. May return NULL if
51 // an attribute value is invalid. 51 // an attribute value is invalid. |creation_time| may not be null.
52 static std::unique_ptr<CanonicalCookie> Create( 52 static std::unique_ptr<CanonicalCookie> Create(
53 const GURL& url, 53 const GURL& url,
54 const std::string& cookie_line, 54 const std::string& cookie_line,
55 const base::Time& creation_time, 55 const base::Time& creation_time,
56 const CookieOptions& options); 56 const CookieOptions& options);
57 57
58 const std::string& Name() const { return name_; } 58 const std::string& Name() const { return name_; }
59 const std::string& Value() const { return value_; } 59 const std::string& Value() const { return value_; }
60 const std::string& Domain() const { return domain_; } 60 const std::string& Domain() const { return domain_; }
61 const std::string& Path() const { return path_; } 61 const std::string& Path() const { return path_; }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // that the creation time is null, or 152 // that the creation time is null, or
153 // * It can be derived from a cookie created by CanonicalCookie::Create by 153 // * It can be derived from a cookie created by CanonicalCookie::Create by
154 // entry into and retrieval from a cookie store (specifically, this means 154 // entry into and retrieval from a cookie store (specifically, this means
155 // by the setting of an creation time in place of a null creation time, and 155 // by the setting of an creation time in place of a null creation time, and
156 // the setting of a last access time). 156 // the setting of a last access time).
157 // An additional requirement on a CanonicalCookie is that if the last 157 // An additional requirement on a CanonicalCookie is that if the last
158 // access time is non-null, the creation time must also be non-null and 158 // access time is non-null, the creation time must also be non-null and
159 // greater than the last access time. 159 // greater than the last access time.
160 bool IsCanonical() const; 160 bool IsCanonical() const;
161 161
162 // Sets the creation date of the cookie to the specified value. It
163 // is only valid to call this method if the existing creation date
164 // is null.
165 void SetCreationDate(base::Time new_creation_date);
166
162 private: 167 private:
163 FRIEND_TEST_ALL_PREFIXES(CanonicalCookieTest, TestPrefixHistograms); 168 FRIEND_TEST_ALL_PREFIXES(CanonicalCookieTest, TestPrefixHistograms);
164 169
165 // The special cookie prefixes as defined in 170 // The special cookie prefixes as defined in
166 // https://tools.ietf.org/html/draft-west-cookie-prefixes 171 // https://tools.ietf.org/html/draft-west-cookie-prefixes
167 // 172 //
168 // This enum is being histogrammed; do not reorder or remove values. 173 // This enum is being histogrammed; do not reorder or remove values.
169 enum CookiePrefix { 174 enum CookiePrefix {
170 COOKIE_PREFIX_NONE = 0, 175 COOKIE_PREFIX_NONE = 0,
171 COOKIE_PREFIX_SECURE, 176 COOKIE_PREFIX_SECURE,
(...skipping 28 matching lines...) Expand all
200 bool httponly_; 205 bool httponly_;
201 CookieSameSite same_site_; 206 CookieSameSite same_site_;
202 CookiePriority priority_; 207 CookiePriority priority_;
203 }; 208 };
204 209
205 typedef std::vector<CanonicalCookie> CookieList; 210 typedef std::vector<CanonicalCookie> CookieList;
206 211
207 } // namespace net 212 } // namespace net
208 213
209 #endif // NET_COOKIES_CANONICAL_COOKIE_H_ 214 #endif // NET_COOKIES_CANONICAL_COOKIE_H_
OLDNEW
« no previous file with comments | « ios/net/cookies/cookie_store_ios_persistent.mm ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698