[Download Notification] change notification type from SIMPLE to BASE_FORMAT
[chromium-blink-merge.git] / ios / net / cookies / system_cookie_util.h
blob888ddbf57bf05ae577450a7f334f8e6ed0141444
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.
5 #ifndef IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_
6 #define IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_
8 #include "net/cookies/canonical_cookie.h"
10 #if defined(__OBJC__)
11 @class NSHTTPCookie;
12 #else
13 class NSHTTPCookie;
14 #endif
16 namespace base {
17 class Time;
20 namespace net {
22 // Converts NSHTTPCookie to net::CanonicalCookie.
23 net::CanonicalCookie CanonicalCookieFromSystemCookie(
24 NSHTTPCookie* cookie,
25 const base::Time& ceation_time);
27 // Converts net::CanonicalCookie to NSHTTPCookie.
28 NSHTTPCookie* SystemCookieFromCanonicalCookie(
29 const net::CanonicalCookie& cookie);
31 enum CookieEvent {
32 COOKIES_READ, // Cookies have been read from disk.
33 COOKIES_APPLICATION_FOREGROUNDED // The application has been foregrounded.
36 // Report metrics if the number of cookies drops unexpectedly.
37 void CheckForCookieLoss(size_t cookie_count, CookieEvent event);
39 // Reset the cookie count internally used by the CheckForCookieLoss() function.
40 void ResetCookieCountMetrics();
42 } // namespace net
44 #endif // IOS_NET_COOKIES_SYSTEM_COOKIE_UTIL_H_