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

Side by Side Diff: ios/chrome/browser/crash_loop_detection_util.mm

Issue 2566993002: [ObjC ARC] Converts ios/chrome/browser:browser to ARC. (Closed)
Patch Set: comments Created 4 years 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
« no previous file with comments | « ios/chrome/browser/chrome_url_util.mm ('k') | ios/chrome/browser/experimental_flags.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome/browser/crash_loop_detection_util.h" 5 #include "ios/chrome/browser/crash_loop_detection_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
9 namespace { 13 namespace {
10 NSString* const kAppStartupFailureCountKey = @"AppStartupFailureCount"; 14 NSString* const kAppStartupFailureCountKey = @"AppStartupFailureCount";
11 } 15 }
12 16
13 namespace crash_util { 17 namespace crash_util {
14 18
15 int GetFailedStartupAttemptCount() { 19 int GetFailedStartupAttemptCount() {
16 static int startup_attempt_count = -1; 20 static int startup_attempt_count = -1;
17 if (startup_attempt_count == -1) { 21 if (startup_attempt_count == -1) {
18 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 22 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
(...skipping 13 matching lines...) Expand all
32 36
33 void ResetFailedStartupAttemptCount() { 37 void ResetFailedStartupAttemptCount() {
34 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 38 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
35 if ([defaults integerForKey:kAppStartupFailureCountKey] != 0) { 39 if ([defaults integerForKey:kAppStartupFailureCountKey] != 0) {
36 [defaults setInteger:0 forKey:kAppStartupFailureCountKey]; 40 [defaults setInteger:0 forKey:kAppStartupFailureCountKey];
37 [defaults synchronize]; 41 [defaults synchronize];
38 } 42 }
39 } 43 }
40 44
41 } // namespace crash_util 45 } // namespace crash_util
OLDNEW
« no previous file with comments | « ios/chrome/browser/chrome_url_util.mm ('k') | ios/chrome/browser/experimental_flags.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698