| OLD | NEW |
| 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 "components/gcm_driver/gcm_stats_recorder_impl.h" | 5 #include "components/gcm_driver/gcm_stats_recorder_impl.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 base::StringPrintf("Delayed for %" PRId64 " msec", | 199 base::StringPrintf("Delayed for %" PRId64 " msec", |
| 200 delay_msec)); | 200 delay_msec)); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void GCMStatsRecorderImpl::RecordCheckinSuccess() { | 203 void GCMStatsRecorderImpl::RecordCheckinSuccess() { |
| 204 if (!is_recording_) | 204 if (!is_recording_) |
| 205 return; | 205 return; |
| 206 RecordCheckin("Checkin succeeded", std::string()); | 206 RecordCheckin("Checkin succeeded", std::string()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void GCMStatsRecorderImpl::RecordCheckinFailure(std::string status, | 209 void GCMStatsRecorderImpl::RecordCheckinFailure(const std::string& status, |
| 210 bool will_retry) { | 210 bool will_retry) { |
| 211 if (!is_recording_) | 211 if (!is_recording_) |
| 212 return; | 212 return; |
| 213 RecordCheckin("Checkin failed", base::StringPrintf( | 213 RecordCheckin("Checkin failed", base::StringPrintf( |
| 214 "%s.%s", | 214 "%s.%s", |
| 215 status.c_str(), | 215 status.c_str(), |
| 216 will_retry ? " Will retry." : "Will not retry.")); | 216 will_retry ? " Will retry." : "Will not retry.")); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void GCMStatsRecorderImpl::RecordConnection( | 219 void GCMStatsRecorderImpl::RecordConnection( |
| 220 const std::string& event, | 220 const std::string& event, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 const std::string& receiver_id, | 517 const std::string& receiver_id, |
| 518 const std::string& message_id) { | 518 const std::string& message_id) { |
| 519 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); | 519 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); |
| 520 if (!is_recording_) | 520 if (!is_recording_) |
| 521 return; | 521 return; |
| 522 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", | 522 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", |
| 523 std::string()); | 523 std::string()); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace gcm | 526 } // namespace gcm |
| OLD | NEW |