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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 case gcm::RegistrationRequest::UNKNOWN_ERROR: | 99 case gcm::RegistrationRequest::UNKNOWN_ERROR: |
100 return "UNKNOWN_ERROR"; | 100 return "UNKNOWN_ERROR"; |
101 case gcm::RegistrationRequest::URL_FETCHING_FAILED: | 101 case gcm::RegistrationRequest::URL_FETCHING_FAILED: |
102 return "URL_FETCHING_FAILED"; | 102 return "URL_FETCHING_FAILED"; |
103 case gcm::RegistrationRequest::HTTP_NOT_OK: | 103 case gcm::RegistrationRequest::HTTP_NOT_OK: |
104 return "HTTP_NOT_OK"; | 104 return "HTTP_NOT_OK"; |
105 case gcm::RegistrationRequest::NO_RESPONSE_BODY: | 105 case gcm::RegistrationRequest::NO_RESPONSE_BODY: |
106 return "NO_RESPONSE_BODY"; | 106 return "NO_RESPONSE_BODY"; |
107 case gcm::RegistrationRequest::REACHED_MAX_RETRIES: | 107 case gcm::RegistrationRequest::REACHED_MAX_RETRIES: |
108 return "REACHED_MAX_RETRIES"; | 108 return "REACHED_MAX_RETRIES"; |
| 109 case gcm::RegistrationRequest::RESPONSE_PARSING_FAILED: |
| 110 return "RESPONSE_PARSING_FAILED"; |
| 111 case gcm::RegistrationRequest::INTERNAL_SERVER_ERROR: |
| 112 return "INTERNAL_SERVER_ERROR"; |
| 113 case gcm::RegistrationRequest::QUOTA_EXCEEDED: |
| 114 return "QUOTA_EXCEEDED"; |
| 115 case gcm::RegistrationRequest::TOO_MANY_REGISTRATIONS: |
| 116 return "TOO_MANY_REGISTRATIONS"; |
109 case gcm::RegistrationRequest::STATUS_COUNT: | 117 case gcm::RegistrationRequest::STATUS_COUNT: |
110 NOTREACHED(); | 118 NOTREACHED(); |
111 break; | 119 break; |
112 } | 120 } |
113 return "UNKNOWN_STATUS"; | 121 return "UNKNOWN_STATUS"; |
114 } | 122 } |
115 | 123 |
116 // Helper for getting string representation of the RegistrationRequest::Status | 124 // Helper for getting string representation of the RegistrationRequest::Status |
117 // enum. | 125 // enum. |
118 std::string GetUnregistrationStatusString( | 126 std::string GetUnregistrationStatusString( |
(...skipping 14 matching lines...) Expand all Loading... |
133 case gcm::UnregistrationRequest::SERVICE_UNAVAILABLE: | 141 case gcm::UnregistrationRequest::SERVICE_UNAVAILABLE: |
134 return "SERVICE_UNAVAILABLE"; | 142 return "SERVICE_UNAVAILABLE"; |
135 case gcm::UnregistrationRequest::INTERNAL_SERVER_ERROR: | 143 case gcm::UnregistrationRequest::INTERNAL_SERVER_ERROR: |
136 return "INTERNAL_SERVER_ERROR"; | 144 return "INTERNAL_SERVER_ERROR"; |
137 case gcm::UnregistrationRequest::HTTP_NOT_OK: | 145 case gcm::UnregistrationRequest::HTTP_NOT_OK: |
138 return "HTTP_NOT_OK"; | 146 return "HTTP_NOT_OK"; |
139 case gcm::UnregistrationRequest::UNKNOWN_ERROR: | 147 case gcm::UnregistrationRequest::UNKNOWN_ERROR: |
140 return "UNKNOWN_ERROR"; | 148 return "UNKNOWN_ERROR"; |
141 case gcm::UnregistrationRequest::REACHED_MAX_RETRIES: | 149 case gcm::UnregistrationRequest::REACHED_MAX_RETRIES: |
142 return "REACHED_MAX_RETRIES"; | 150 return "REACHED_MAX_RETRIES"; |
| 151 case gcm::UnregistrationRequest::DEVICE_REGISTRATION_ERROR: |
| 152 return "DEVICE_REGISTRATION_ERROR"; |
143 case gcm::UnregistrationRequest::UNREGISTRATION_STATUS_COUNT: | 153 case gcm::UnregistrationRequest::UNREGISTRATION_STATUS_COUNT: |
144 NOTREACHED(); | 154 NOTREACHED(); |
145 break; | 155 break; |
146 } | 156 } |
147 return "UNKNOWN_STATUS"; | 157 return "UNKNOWN_STATUS"; |
148 } | 158 } |
149 | 159 |
150 } // namespace | 160 } // namespace |
151 | 161 |
152 GCMStatsRecorderImpl::GCMStatsRecorderImpl() | 162 GCMStatsRecorderImpl::GCMStatsRecorderImpl() |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 const std::string& receiver_id, | 553 const std::string& receiver_id, |
544 const std::string& message_id) { | 554 const std::string& message_id) { |
545 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); | 555 UMA_HISTOGRAM_COUNTS("GCM.IncomingSendErrors", 1); |
546 if (!is_recording_) | 556 if (!is_recording_) |
547 return; | 557 return; |
548 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", | 558 RecordSending(app_id, receiver_id, message_id, "Received 'send error' msg", |
549 std::string()); | 559 std::string()); |
550 } | 560 } |
551 | 561 |
552 } // namespace gcm | 562 } // namespace gcm |
OLD | NEW |