1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "google_apis/gcm/engine/gcm_registration_request_handler.h"
7 #include "base/metrics/histogram.h"
8 #include "google_apis/gcm/base/gcm_util.h"
15 const char kSenderKey
[] = "sender";
19 GCMRegistrationRequestHandler::GCMRegistrationRequestHandler(
20 const std::string
& senders
)
24 GCMRegistrationRequestHandler::~GCMRegistrationRequestHandler() {}
26 void GCMRegistrationRequestHandler::BuildRequestBody(std::string
* body
){
27 BuildFormEncoding(kSenderKey
, senders_
, body
);
30 void GCMRegistrationRequestHandler::ReportUMAs(
31 RegistrationRequest::Status status
,
33 base::TimeDelta complete_time
) {
34 UMA_HISTOGRAM_ENUMERATION("GCM.RegistrationRequestStatus",
36 RegistrationRequest::STATUS_COUNT
);
38 // Other UMAs are only reported when the request succeeds.
39 if (status
!= RegistrationRequest::SUCCESS
)
42 UMA_HISTOGRAM_COUNTS("GCM.RegistrationRetryCount", retry_count
);
43 UMA_HISTOGRAM_TIMES("GCM.RegistrationCompleteTime", complete_time
);