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

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

Issue 593243002: Profile_Metrics integration with Keystone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove separate attribute header; refactor setActive methods. Created 6 years, 2 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_registration.h
diff --git a/chrome/browser/mac/keystone_registration.h b/chrome/browser/mac/keystone_registration.h
index 056dde1f0b58ada46470544aa54e9735bcfe7cb5..5159796429fd664208225871aca3c18f5a3fcd06 100644
--- a/chrome/browser/mac/keystone_registration.h
+++ b/chrome/browser/mac/keystone_registration.h
@@ -52,6 +52,12 @@ extern NSString* KSRegistrationRemoveExistingTag;
} // namespace keystone_registration
+typedef enum {
+ kKSReportingAggregationSum = 0, // Adds attribute value across user accounts
+
+ kKSReportingAggregationDefault = kKSReportingAggregationSum,
+} KSReportingAggregationType;
+
@interface KSRegistration : NSObject
+ (id)registrationWithProductID:(NSString*)productID;
@@ -62,10 +68,56 @@ extern NSString* KSRegistrationRemoveExistingTag;
authorization:(AuthorizationRef)authorization;
- (BOOL)setActive;
+- (BOOL)setActiveWithReportingAttributes:(NSArray*)reportingAttributes
+ error:(NSError**)error;
- (void)checkForUpdateWasUserInitiated:(BOOL)userInitiated;
- (void)startUpdate;
- (keystone_registration::KSRegistrationTicketType)ticketType;
@end // @interface KSRegistration
+
+// Declarations of the Keystone attribute reporting bits needed here. From
+// KSReportingAttribute.h.
+@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 KSReportingAttribute
+
+@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 // @interface KSUnsignedReportingAttribute
+
#endif // CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_

Powered by Google App Engine
This is Rietveld 408576698