Add ICU message format support
[chromium-blink-merge.git] / google_apis / gcm / engine / gcm_registration_request_handler.cc
blob9533165d66b6f3206e53f93ab1ab6588887c9fe5
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"
10 namespace gcm {
12 namespace {
14 // Request constants.
15 const char kSenderKey[] = "sender";
17 } // namespace
19 GCMRegistrationRequestHandler::GCMRegistrationRequestHandler(
20 const std::string& senders)
21 : senders_(senders) {
24 GCMRegistrationRequestHandler::~GCMRegistrationRequestHandler() {}
26 void GCMRegistrationRequestHandler::BuildRequestBody(std::string* body){
27 BuildFormEncoding(kSenderKey, senders_, body);
30 void GCMRegistrationRequestHandler::ReportUMAs(
31 RegistrationRequest::Status status,
32 int retry_count,
33 base::TimeDelta complete_time) {
34 UMA_HISTOGRAM_ENUMERATION("GCM.RegistrationRequestStatus",
35 status,
36 RegistrationRequest::STATUS_COUNT);
38 // Other UMAs are only reported when the request succeeds.
39 if (status != RegistrationRequest::SUCCESS)
40 return;
42 UMA_HISTOGRAM_COUNTS("GCM.RegistrationRetryCount", retry_count);
43 UMA_HISTOGRAM_TIMES("GCM.RegistrationCompleteTime", complete_time);
46 } // namespace gcm