Index: ios/chrome/app/application_delegate/memory_warning_helper.h |
diff --git a/ios/chrome/app/application_delegate/memory_warning_helper.h b/ios/chrome/app/application_delegate/memory_warning_helper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dbdb2ba1a27835dd58d16e3fa8d8fe0333402ae2 |
--- /dev/null |
+++ b/ios/chrome/app/application_delegate/memory_warning_helper.h |
@@ -0,0 +1,26 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef IOS_CHROME_APP_APPLICATION_DELEGATE_MEMORY_RECOVERY_HELPER_H_ |
+#define IOS_CHROME_APP_APPLICATION_DELEGATE_MEMORY_RECOVERY_HELPER_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+// Helper for handling memory warnings. |
+@interface MemoryWarningHelper : NSObject |
+ |
+// The number of memory warnings that have been received in this |
+// foreground session. |
+@property(nonatomic, readonly) NSInteger foregroundMemoryWarningCount; |
+ |
+// Frees as much memory as possible and registers that there was a memory |
+// pressure. |
+- (void)handleMemoryPressure; |
+ |
+// Resets the foregroundMemoryWarningCount property, setting its value to 0. |
+- (void)resetForegroundMemoryWarningCount; |
+ |
+@end |
+ |
+#endif // IOS_CHROME_APP_APPLICATION_DELEGATE_MEMORY_RECOVERY_HELPER_H_ |