OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_ |
| 6 #define IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_ |
| 7 |
| 8 #include "net/cookies/canonical_cookie.h" |
| 9 |
| 10 #if defined(__OBJC__) |
| 11 @class NSHTTPCookie; |
| 12 #else |
| 13 class NSHTTPCookie; |
| 14 #endif |
| 15 |
| 16 namespace base { |
| 17 class Time; |
| 18 } |
| 19 |
| 20 namespace net { |
| 21 |
| 22 // Converts NSHTTPCookie to net::CanonicalCookie. |
| 23 net::CanonicalCookie CanonicalCookieFromSystemCookie( |
| 24 NSHTTPCookie* cookie, |
| 25 const base::Time& ceation_time); |
| 26 |
| 27 // Converts net::CanonicalCookie to NSHTTPCookie. |
| 28 NSHTTPCookie* SystemCookieFromCanonicalCookie( |
| 29 const net::CanonicalCookie& cookie); |
| 30 |
| 31 enum CookieEvent { |
| 32 COOKIES_READ, // Cookies have been read from disk. |
| 33 COOKIES_APPLICATION_FOREGROUNDED // The application has been foregrounded. |
| 34 }; |
| 35 |
| 36 // Report metrics if the number of cookies drops unexpectedly. |
| 37 void CheckForCookieLoss(size_t cookie_count, CookieEvent event); |
| 38 |
| 39 // Reset the cookie count internally used by the CheckForCookieLoss() function. |
| 40 void ResetCookieCountMetrics(); |
| 41 |
| 42 } // namespace net |
| 43 |
| 44 #endif // IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_ |
OLD | NEW |