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

Unified Diff: ios/chrome/browser/crash_report/crash_report_multi_parameter.h

Issue 1207353005: [iOS] Upstream some stability code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/crash_report/crash_report_multi_parameter.h
diff --git a/ios/chrome/browser/crash_report/crash_report_multi_parameter.h b/ios/chrome/browser/crash_report/crash_report_multi_parameter.h
new file mode 100644
index 0000000000000000000000000000000000000000..0175367b8dd6ec649ba811bd66f8bd2789286ea3
--- /dev/null
+++ b/ios/chrome/browser/crash_report/crash_report_multi_parameter.h
@@ -0,0 +1,36 @@
+// Copyright 2014 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_BROWSER_CRASH_REPORT_CRASH_REPORT_MULTI_PARAMETER_H_
+#define IOS_CHROME_BROWSER_CRASH_REPORT_CRASH_REPORT_MULTI_PARAMETER_H_
+
+#include <Foundation/Foundation.h>
+
sdefresne 2015/07/08 14:18:34 #include "base/logging.h"
+// CrashReportMultiParameter keeps state of multiple report values that will be
+// grouped in a single breakpad element to save limited number of breakpad
+// values.
+@interface CrashReportMultiParameter : NSObject
+// Init with the breakpad parameter key.
+- (id)initWithKey:(NSString*)key;
sdefresne 2015/07/08 14:18:34 id -> instancetype and maybe NS_DESIGNATED_INITIAL
+
sdefresne 2015/07/08 14:18:34 - (instancetype)init NS_UNAVAILABLE;
+// Adds or updates an element in the dictionary of the breakpad report. Value
+// are stored in the instance so every time you call this function, the whole
+// JSON dictionary is regenerated. The total size of the serialized dictionary
+// bmust e under 256 bytes due to Breakpad limitation. Setting a value to 0 will
+// not remove the key. Use [removeValue:key] instead.
+- (void)setValue:(NSString*)key withValue:(int)value;
+
+// Removes the key element from the dictionary. Note that this is different from
+// setting the parameter to 0 or false.
+- (void)removeValue:(NSString*)key;
+
+// Increases the key element by one.
+- (void)incrementValue:(NSString*)key;
+
+// Decreases the key element by one. If the element is 0, the element is removed
+// from the dictionary.
+- (void)decrementValue:(NSString*)key;
+@end
+
+#endif // IOS_CHROME_BROWSER_CRASH_REPORT_CRASH_REPORT_MULTI_PARAMETER_H_

Powered by Google App Engine
This is Rietveld 408576698