Chromium Code Reviews| 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. |
|
Mark Mentovai
2014/10/02 16:07:23
No (c) in new files.
Mark Mentovai
2014/10/02 16:07:23
I think this should just go in-line in keystone_re
Mike Lerman
2014/10/06 16:49:08
I was mirroring the file structure of the Keystone
Mark Mentovai
2014/10/06 18:35:13
Mike Lerman wrote:
Mike Lerman
2014/10/09 20:41:01
Ok. Done.
|
| +// 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_ |