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

Unified Diff: chrome/browser/mac/keystone_reporting_attribute.h

Issue 593243002: Profile_Metrics integration with Keystone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better error handling Created 6 years, 3 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: chrome/browser/mac/keystone_reporting_attribute.h
diff --git a/chrome/browser/mac/keystone_reporting_attribute.h b/chrome/browser/mac/keystone_reporting_attribute.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2389d0499787643d5e23d5ce408f7eeba58a1cb
--- /dev/null
+++ b/chrome/browser/mac/keystone_reporting_attribute.h
@@ -0,0 +1,58 @@
+// Copyright (c) 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 CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_
+#define CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_
+
+// Declarations of the Keystone attribute reporting bits needed here. From
+// KSReportingAttribute.h.
+
+typedef enum {
+ kKSReportingAggregationSum = 0, // Adds attribute value across user accounts
+
+ kKSReportingAggregationDefault = kKSReportingAggregationSum,
+} KSReportingAggregationType;
+
+@interface KSReportingAttribute : NSObject
+
+// How long the attribute will live after being set. The clock starts ticking
+// after the call to setActiveWithReportingAttributes.
+- (NSTimeInterval)lifetime;
+- (BOOL)setLifetime:(NSTimeInterval)lifetime error:(NSError **)error;
+
+// The method returns the value stored, as a generic NSObject. Derived classes
+// accessors provide a more specific data type.
+- (id<NSObject>)value;
+
+// The name of the attribute. setName checks that the name starts with a letter
+// and contains only Latin letters, digits and '_', '-'.
+- (NSString *)name;
+- (BOOL)setName:(NSString *)name error:(NSError **)error;
+
+// Confirms if a name is correct. Typically called by setName and helper
+// methods. See "setName" for definition of "correctness".
++ (BOOL)verifyAttributeName:(NSString *)name error:(NSError **)error;
+
+// Prints information about the attribute. Used for debugging purposes.
+- (NSString *)description;
+
+@end
+
+@interface KSUnsignedReportingAttribute : KSReportingAttribute
+
++ (KSUnsignedReportingAttribute *)reportingAttributeWithValue:(uint32_t)value
+ name:(NSString *)name
+ aggregationType:(KSReportingAggregationType)aggregationType
+ error:(NSError **)error;
+
+// Get/set the value of the attribute as "unsigned int"
+- (uint32_t)unsignedIntValue;
+- (void)setUnsignedIntValue:(uint32_t)value;
+
+- (KSReportingAggregationType)aggregationType;
+- (void)setAggregationType:(KSReportingAggregationType)aggregationType;
+
+@end
+
+#endif // CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_

Powered by Google App Engine
This is Rietveld 408576698