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

Unified Diff: chrome/browser/mac/keystone_glue.mm

Issue 974423002: Revert of Profile_Metrics integration with Keystone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/mac/keystone_glue.h ('k') | chrome/browser/mac/keystone_glue_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/keystone_glue.mm
diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm
index 42b6b49e2c4b3db0135f78da0cad7ef3b8731d46..bd0e12e827bc302fd7b6a1a44a19f03f081f1392 100644
--- a/chrome/browser/mac/keystone_glue.mm
+++ b/chrome/browser/mac/keystone_glue.mm
@@ -118,9 +118,6 @@
// Called when Keystone registration completes.
- (void)registrationComplete:(NSNotification*)notification;
-
-// Set the registration active and pass profile count parameters.
-- (void)setRegistrationActive;
// Called periodically to announce activity by pinging the Keystone server.
- (void)markActive:(NSTimer*)timer;
@@ -448,8 +445,6 @@
return NO;
registration_ = [ksr retain];
- ksUnsignedReportingAttributeClass_ =
- [ksrBundle classNamed:@"KSUnsignedReportingAttribute"];
return YES;
}
@@ -496,47 +491,6 @@
nil];
}
-- (void)setRegistrationActive {
- if (!registration_)
- return;
-
- // Should never have zero profiles. Do not report this value.
- if (!numProfiles_) {
- [registration_ setActive];
- return;
- }
-
- NSError* reportingError = nil;
-
- KSReportingAttribute* numAccountsAttr =
- [ksUnsignedReportingAttributeClass_
- reportingAttributeWithValue:numProfiles_
- name:@"_NumAccounts"
- aggregationType:kKSReportingAggregationSum
- error:&reportingError];
- if (reportingError != nil)
- VLOG(1) << [reportingError localizedDescription];
- reportingError = nil;
-
- KSReportingAttribute* numSignedInAccountsAttr =
- [ksUnsignedReportingAttributeClass_
- reportingAttributeWithValue:numSignedInProfiles_
- name:@"_NumSignedIn"
- aggregationType:kKSReportingAggregationSum
- error:&reportingError];
- if (reportingError != nil)
- VLOG(1) << [reportingError localizedDescription];
- reportingError = nil;
-
- NSArray* profileCountsInformation =
- [NSArray arrayWithObjects:numAccountsAttr, numSignedInAccountsAttr, nil];
-
- if (![registration_ setActiveWithReportingAttributes:profileCountsInformation
- error:&reportingError]) {
- VLOG(1) << [reportingError localizedDescription];
- }
-}
-
- (void)registerWithKeystone {
[self updateStatus:kAutoupdateRegistering version:nil];
@@ -558,13 +512,13 @@
// posted, and -registrationComplete: will be called.
// Mark an active RIGHT NOW; don't wait an hour for the first one.
- [self setRegistrationActive];
+ [registration_ setActive];
// Set up hourly activity pings.
timer_ = [NSTimer scheduledTimerWithTimeInterval:60 * 60 // One hour
target:self
selector:@selector(markActive:)
- userInfo:nil
+ userInfo:registration_
repeats:YES];
}
@@ -587,7 +541,8 @@
}
- (void)markActive:(NSTimer*)timer {
- [self setRegistrationActive];
+ KSRegistration* ksr = [timer userInfo];
+ [ksr setActive];
}
- (void)checkForUpdate {
@@ -1094,13 +1049,6 @@
return tagSuffix;
}
-
-- (void)updateProfileCountsWithNumProfiles:(uint32_t)profiles
- numSignedInProfiles:(uint32_t)signedInProfiles {
- numProfiles_ = profiles;
- numSignedInProfiles_ = signedInProfiles;
-}
-
@end // @implementation KeystoneGlue
namespace {
« no previous file with comments | « chrome/browser/mac/keystone_glue.h ('k') | chrome/browser/mac/keystone_glue_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698