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_client_impl.h" | 5 #include "components/gcm_driver/gcm_client_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const gcm::GCMClient::OutgoingMessage& message) { | 161 const gcm::GCMClient::OutgoingMessage& message) { |
162 OutgoingMessageTTLCategory ttl_category; | 162 OutgoingMessageTTLCategory ttl_category; |
163 if (message.time_to_live == 0) | 163 if (message.time_to_live == 0) |
164 ttl_category = TTL_ZERO; | 164 ttl_category = TTL_ZERO; |
165 else if (message.time_to_live <= 60 ) | 165 else if (message.time_to_live <= 60 ) |
166 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_MINUTE; | 166 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_MINUTE; |
167 else if (message.time_to_live <= 60 * 60) | 167 else if (message.time_to_live <= 60 * 60) |
168 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_HOUR; | 168 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_HOUR; |
169 else if (message.time_to_live <= 24 * 60 * 60) | 169 else if (message.time_to_live <= 24 * 60 * 60) |
170 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_DAY; | 170 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_DAY; |
171 else if (message.time_to_live <= 7 * 24 * 60 * 60) | |
172 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_WEEK; | |
173 else if (message.time_to_live < gcm::GCMClient::OutgoingMessage::kMaximumTTL) | |
174 ttl_category = TTL_MORE_THAN_ONE_WEEK; | |
175 else | 171 else |
176 ttl_category = TTL_MAXIMUM; | 172 ttl_category = TTL_MAXIMUM; |
177 | 173 |
178 UMA_HISTOGRAM_ENUMERATION("GCM.GCMOutgoingMessageTTLCategory", | 174 UMA_HISTOGRAM_ENUMERATION("GCM.OutgoingMessageTTL", |
179 ttl_category, | 175 ttl_category, |
180 TTL_CATEGORY_COUNT); | 176 TTL_CATEGORY_COUNT); |
181 } | 177 } |
182 | 178 |
183 } // namespace | 179 } // namespace |
184 | 180 |
185 GCMInternalsBuilder::GCMInternalsBuilder() {} | 181 GCMInternalsBuilder::GCMInternalsBuilder() {} |
186 GCMInternalsBuilder::~GCMInternalsBuilder() {} | 182 GCMInternalsBuilder::~GCMInternalsBuilder() {} |
187 | 183 |
188 scoped_ptr<base::Clock> GCMInternalsBuilder::BuildClock() { | 184 scoped_ptr<base::Clock> GCMInternalsBuilder::BuildClock() { |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 949 |
954 recorder_.RecordIncomingSendError( | 950 recorder_.RecordIncomingSendError( |
955 data_message_stanza.category(), | 951 data_message_stanza.category(), |
956 data_message_stanza.to(), | 952 data_message_stanza.to(), |
957 data_message_stanza.id()); | 953 data_message_stanza.id()); |
958 delegate_->OnMessageSendError(data_message_stanza.category(), | 954 delegate_->OnMessageSendError(data_message_stanza.category(), |
959 send_error_details); | 955 send_error_details); |
960 } | 956 } |
961 | 957 |
962 } // namespace gcm | 958 } // namespace gcm |
OLD | NEW |