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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 2471433003: [GCM] Update ResetStore histograms (Closed)
Patch Set: Mark old histo as obsolete Created 4 years, 1 month 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: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index 080a7d006fb208bdbcff659566dec87c476f049b..c1a02de6be833a3163cdb78274522a8846c391f5 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -233,7 +233,8 @@ void RecordOutgoingMessageToUMA(const gcm::OutgoingMessage& message) {
}
void RecordResetStoreErrorToUMA(ResetStoreError error) {
- UMA_HISTOGRAM_ENUMERATION("GCM.ResetStore", error, RESET_STORE_ERROR_COUNT);
+ UMA_HISTOGRAM_ENUMERATION("GCM.ResetStoreError", error,
+ RESET_STORE_ERROR_COUNT);
}
} // namespace
@@ -394,7 +395,7 @@ void GCMClientImpl::OnLoadCompleted(
}
} else {
// Otherwise, destroy the store to try again.
- ResetStore();
+ ResetStore(LOAD_FAILURE);
}
return;
}
@@ -543,7 +544,7 @@ void GCMClientImpl::DestroyStoreWhenNotNeeded() {
weak_ptr_factory_.GetWeakPtr()));
}
-void GCMClientImpl::ResetStore() {
+void GCMClientImpl::ResetStore(ResetReason reset_reason) {
// If already being reset, don't do it again. We want to prevent from
// resetting and loading from the store again and again.
if (gcm_store_reset_) {
@@ -552,6 +553,8 @@ void GCMClientImpl::ResetStore() {
return;
}
gcm_store_reset_ = true;
+ UMA_HISTOGRAM_ENUMERATION("GCM.ResetStoreReason", reset_reason,
+ RESET_REASON_COUNT);
// Destroy the GCM store to start over.
gcm_store_->Destroy(base::Bind(&GCMClientImpl::ResetStoreCallback,
@@ -706,7 +709,7 @@ void GCMClientImpl::OnCheckinCompleted(
if (response_code == net::HTTP_UNAUTHORIZED ||
response_code == net::HTTP_BAD_REQUEST) {
LOG(ERROR) << "Checkin rejected. Resetting GCM Store.";
- ResetStore();
+ ResetStore(CHECKIN_REJECTED);
return;
}

Powered by Google App Engine
This is Rietveld 408576698