OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "ios/net/cookies/system_cookie_util.h" | 5 #include "ios/net/cookies/system_cookie_util.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
14 #include "net/cookies/cookie_constants.h" | 14 #include "net/cookies/cookie_constants.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
| 17 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 18 #error "This file requires ARC support." |
| 19 #endif |
| 20 |
17 namespace net { | 21 namespace net { |
18 | 22 |
19 namespace { | 23 namespace { |
20 | 24 |
21 // Used to report cookie loss events in UMA. | 25 // Used to report cookie loss events in UMA. |
22 enum CookieLossType { | 26 enum CookieLossType { |
23 LOSS, | 27 LOSS, |
24 NOT_ENOUGH_COOKIES, // Not enough cookies, error checking is disabled. | 28 NOT_ENOUGH_COOKIES, // Not enough cookies, error checking is disabled. |
25 NO_LOSS, | 29 NO_LOSS, |
26 COOKIE_LOSS_ENUM_COUNT | 30 COOKIE_LOSS_ENUM_COUNT |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ResetCookieCountMetrics(); | 151 ResetCookieCountMetrics(); |
148 } | 152 } |
149 | 153 |
150 void ResetCookieCountMetrics() { | 154 void ResetCookieCountMetrics() { |
151 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | 155 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
152 [defaults setBool:NO forKey:kCheckCookieLossKey]; | 156 [defaults setBool:NO forKey:kCheckCookieLossKey]; |
153 [defaults synchronize]; | 157 [defaults synchronize]; |
154 } | 158 } |
155 | 159 |
156 } // namespace net | 160 } // namespace net |
OLD | NEW |