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

Unified Diff: google_apis/gcm/engine/checkin_request.cc

Issue 202083005: Add activity recording capability to gcm internals page. User can refresh, start/stop recording, an… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 9 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: google_apis/gcm/engine/checkin_request.cc
diff --git a/google_apis/gcm/engine/checkin_request.cc b/google_apis/gcm/engine/checkin_request.cc
index 94a6fc9e38ac8d8d27f9a7cdd0c69f5cd413695b..874924c7f24a2151600629a007ff6b9400d0f423 100644
--- a/google_apis/gcm/engine/checkin_request.cc
+++ b/google_apis/gcm/engine/checkin_request.cc
@@ -53,7 +53,8 @@ CheckinRequest::CheckinRequest(
uint64 android_id,
uint64 security_token,
const std::vector<std::string>& account_ids,
- net::URLRequestContextGetter* request_context_getter)
+ net::URLRequestContextGetter* request_context_getter,
+ GCMStatsRecorder* recorder)
: request_context_getter_(request_context_getter),
callback_(callback),
backoff_entry_(&backoff_policy),
@@ -61,6 +62,7 @@ CheckinRequest::CheckinRequest(
android_id_(android_id),
security_token_(security_token),
account_ids_(account_ids),
+ recorder_(recorder),
weak_ptr_factory_(this) {
}
@@ -118,6 +120,7 @@ void CheckinRequest::RetryWithBackoff(bool update_backoff) {
return;
}
+ recorder_->RecordCheckin(android_id_, GCMStatsRecorder::Retry);
Start();
}
@@ -141,6 +144,7 @@ void CheckinRequest::OnURLFetchComplete(const net::URLFetcher* source) {
<< response_status << ". Checkin failed.";
RecordCheckinStatusToUMA(response_status == net::HTTP_BAD_REQUEST ?
HTTP_BAD_REQUEST : HTTP_UNAUTHORIZED);
+ recorder_->RecordCheckin(android_id_, GCMStatsRecorder::Failure);
callback_.Run(0,0);
return;
}

Powered by Google App Engine
This is Rietveld 408576698