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

Side by Side Diff: google_apis/gcm/engine/checkin_request.cc

Issue 288433002: G-services settings v3 implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing CR feedback Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gcm/engine/checkin_request.h" 5 #include "google_apis/gcm/engine/checkin_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" 10 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h"
11 #include "google_apis/gcm/protocol/checkin.pb.h" 11 #include "google_apis/gcm/protocol/checkin.pb.h"
12 #include "net/http/http_status_code.h" 12 #include "net/http/http_status_code.h"
13 #include "net/url_request/url_fetcher.h" 13 #include "net/url_request/url_fetcher.h"
14 #include "net/url_request/url_request_status.h" 14 #include "net/url_request/url_request_status.h"
15 15
16 namespace gcm { 16 namespace gcm {
17 17
18 namespace { 18 namespace {
19 const char kRequestContentType[] = "application/x-protobuf"; 19 const char kRequestContentType[] = "application/x-protobuf";
20 const int kRequestVersionValue = 2; 20 const int kRequestVersionValue = 3;
21 const int kDefaultUserSerialNumber = 0; 21 const int kDefaultUserSerialNumber = 0;
22 22
23 // This enum is also used in an UMA histogram (GCMCheckinRequestStatus 23 // This enum is also used in an UMA histogram (GCMCheckinRequestStatus
24 // enum defined in tools/metrics/histograms/histogram.xml). Hence the entries 24 // enum defined in tools/metrics/histograms/histogram.xml). Hence the entries
25 // here shouldn't be deleted or re-ordered and new ones should be added to 25 // here shouldn't be deleted or re-ordered and new ones should be added to
26 // the end, and update the GetCheckinRequestStatusString(...) below. 26 // the end, and update the GetCheckinRequestStatusString(...) below.
27 enum CheckinRequestStatus { 27 enum CheckinRequestStatus {
28 SUCCESS, // Checkin completed successfully. 28 SUCCESS, // Checkin completed successfully.
29 URL_FETCHING_FAILED, // URL fetching failed. 29 URL_FETCHING_FAILED, // URL fetching failed.
30 HTTP_BAD_REQUEST, // The request was malformed. 30 HTTP_BAD_REQUEST, // The request was malformed.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 RecordCheckinStatusAndReportUMA(SUCCESS, recorder_, false); 222 RecordCheckinStatusAndReportUMA(SUCCESS, recorder_, false);
223 UMA_HISTOGRAM_COUNTS("GCM.CheckinRetryCount", 223 UMA_HISTOGRAM_COUNTS("GCM.CheckinRetryCount",
224 backoff_entry_.failure_count()); 224 backoff_entry_.failure_count());
225 UMA_HISTOGRAM_TIMES("GCM.CheckinCompleteTime", 225 UMA_HISTOGRAM_TIMES("GCM.CheckinCompleteTime",
226 base::TimeTicks::Now() - request_start_time_); 226 base::TimeTicks::Now() - request_start_time_);
227 callback_.Run(response_proto); 227 callback_.Run(response_proto);
228 } 228 }
229 229
230 } // namespace gcm 230 } // namespace gcm
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698