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

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

Issue 2438513003: When parsing cookie expiration times, saturate out of range dates (Closed)
Patch Set: Response to comments Created 4 years, 2 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
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // Returns true if the cookie should be included for the given request |url|. 132 // Returns true if the cookie should be included for the given request |url|.
133 // HTTP only cookies can be filter by using appropriate cookie |options|. 133 // HTTP only cookies can be filter by using appropriate cookie |options|.
134 // PLEASE NOTE that this method does not check whether a cookie is expired or 134 // PLEASE NOTE that this method does not check whether a cookie is expired or
135 // not! 135 // not!
136 bool IncludeForRequestURL(const GURL& url, 136 bool IncludeForRequestURL(const GURL& url,
137 const CookieOptions& options) const; 137 const CookieOptions& options) const;
138 138
139 std::string DebugString() const; 139 std::string DebugString() const;
140 140
141 static std::string CanonPath(const GURL& url, const ParsedCookie& pc); 141 static std::string CanonPath(const GURL& url, const ParsedCookie& pc);
142
143 // Returns a "null" time if expiration was unspecified or invalid.
142 static base::Time CanonExpiration(const ParsedCookie& pc, 144 static base::Time CanonExpiration(const ParsedCookie& pc,
143 const base::Time& current, 145 const base::Time& current,
144 const base::Time& server_time); 146 const base::Time& server_time);
145 147
146 // Cookie ordering methods. 148 // Cookie ordering methods.
147 149
148 // Returns true if the cookie is less than |other|, considering only name, 150 // Returns true if the cookie is less than |other|, considering only name,
149 // domain and path. In particular, two equivalent cookies (see IsEquivalent()) 151 // domain and path. In particular, two equivalent cookies (see IsEquivalent())
150 // are identical for PartialCompare(). 152 // are identical for PartialCompare().
151 bool PartialCompare(const CanonicalCookie& other) const; 153 bool PartialCompare(const CanonicalCookie& other) const;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 bool httponly_; 214 bool httponly_;
213 CookieSameSite same_site_; 215 CookieSameSite same_site_;
214 CookiePriority priority_; 216 CookiePriority priority_;
215 }; 217 };
216 218
217 typedef std::vector<CanonicalCookie> CookieList; 219 typedef std::vector<CanonicalCookie> CookieList;
218 220
219 } // namespace net 221 } // namespace net
220 222
221 #endif // NET_COOKIES_CANONICAL_COOKIE_H_ 223 #endif // NET_COOKIES_CANONICAL_COOKIE_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_api_helpers.cc ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698