| OLD | NEW |
| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 bool IsOnPath(const std::string& url_path) const; | 110 bool IsOnPath(const std::string& url_path) const; |
| 111 bool IsDomainMatch(const std::string& scheme, const std::string& host) const; | 111 bool IsDomainMatch(const std::string& scheme, const std::string& host) const; |
| 112 | 112 |
| 113 std::string DebugString() const; | 113 std::string DebugString() const; |
| 114 | 114 |
| 115 // Returns the cookie source when cookies are set for |url|. This function | 115 // Returns the cookie source when cookies are set for |url|. This function |
| 116 // is public for unit test purposes only. | 116 // is public for unit test purposes only. |
| 117 static std::string GetCookieSourceFromURL(const GURL& url); | 117 static std::string GetCookieSourceFromURL(const GURL& url); |
| 118 static std::string CanonPath(const GURL& url, const ParsedCookie& pc); | 118 static std::string CanonPath(const GURL& url, const ParsedCookie& pc); |
| 119 static base::Time CanonExpiration(const ParsedCookie& pc, | 119 static base::Time CanonExpiration(const ParsedCookie& pc, |
| 120 const base::Time& current); | 120 const base::Time& current, |
| 121 const base::Time& server_time); |
| 121 | 122 |
| 122 private: | 123 private: |
| 123 // The source member of a canonical cookie is the origin of the URL that tried | 124 // The source member of a canonical cookie is the origin of the URL that tried |
| 124 // to set this cookie, minus the port number if any. This field is not | 125 // to set this cookie, minus the port number if any. This field is not |
| 125 // persistent though; its only used in the in-tab cookies dialog to show the | 126 // persistent though; its only used in the in-tab cookies dialog to show the |
| 126 // user the source URL. This is used for both allowed and blocked cookies. | 127 // user the source URL. This is used for both allowed and blocked cookies. |
| 127 // When a CanonicalCookie is constructed from the backing store (common case) | 128 // When a CanonicalCookie is constructed from the backing store (common case) |
| 128 // this field will be null. CanonicalCookie consumers should not rely on | 129 // this field will be null. CanonicalCookie consumers should not rely on |
| 129 // this field unless they guarantee that the creator of those | 130 // this field unless they guarantee that the creator of those |
| 130 // CanonicalCookies properly initialized the field. | 131 // CanonicalCookies properly initialized the field. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 141 base::Time last_access_date_; | 142 base::Time last_access_date_; |
| 142 bool secure_; | 143 bool secure_; |
| 143 bool httponly_; | 144 bool httponly_; |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 typedef std::vector<CanonicalCookie> CookieList; | 147 typedef std::vector<CanonicalCookie> CookieList; |
| 147 | 148 |
| 148 } // namespace net | 149 } // namespace net |
| 149 | 150 |
| 150 #endif // NET_COOKIES_CANONICAL_COOKIE_H_ | 151 #endif // NET_COOKIES_CANONICAL_COOKIE_H_ |
| OLD | NEW |