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

Side by Side Diff: ios/chrome/browser/metrics/previous_session_info.h

Issue 1207353005: [iOS] Upstream some stability code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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
OLDNEW
(Empty)
1 // Copyright 2015 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_CHROME_BROWSER_METRICS_PREVIOUS_SESSION_INFO_H_
6 #define IOS_CHROME_BROWSER_METRICS_PREVIOUS_SESSION_INFO_H_
7
8 #import <Foundation/Foundation.h>
9
10 // PreviousSessionInfo has two jobs:
11 // - Holding information about the last session, persisted across restart.
12 // These informations are accessible via the properties on the shared
13 // instance.
14 // - Persist information about the current session, for use in a next session.
15 @interface PreviousSessionInfo : NSObject
16
17 // Whether the app received a memory warning seconds before being terminated.
18 @property(nonatomic, assign, readonly)
19 BOOL didSeeMemoryWarningShortlyBeforeTerminating;
20
21 // Whether the app was updated between the previous and the current session.
22 @property(nonatomic, assign, readonly) BOOL isFirstSessionAfterUpgrade;
23
24 // Singleton PreviousSessionInfo. During the lifetime of the app, the returned
25 // object is the same, and describes the previous session, even after a new
26 // session has started (by calling beginRecordingCurrentSession).
27 + (instancetype)sharedInstance;
28
29 // Clears the persisted information about the previous session and starts
30 // persisting information about the current session, for use in a next session.
31 - (void)beginRecordingCurrentSession;
32
33 // When a session has begun, records that a memory warning was received.
34 - (void)setMemoryWarningFlag;
35
36 // When a session has begun, records that any memory warning flagged can be
37 // ignored.
38 - (void)resetMemoryWarningFlag;
39
40 @end
41
42 @interface PreviousSessionInfo (TestingOnly)
43 @property(nonatomic, assign) BOOL didSeeMemoryWarningShortlyBeforeTerminating;
44 + (void)resetSharedInstanceForTesting;
45 @end
46
47 #endif // IOS_CHROME_BROWSER_METRICS_PREVIOUS_SESSION_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698