Chromium Code Reviews| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) | 171 else if (message.time_to_live <= 7 * 24 * 60 * 60) |
| 172 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_WEEK; | 172 ttl_category = TTL_LESS_THAN_OR_EQUAL_TO_ONE_WEEK; |
| 173 else if (message.time_to_live < gcm::GCMClient::OutgoingMessage::kMaximumTTL) | 173 else if (message.time_to_live < gcm::GCMClient::OutgoingMessage::kMaximumTTL) |
| 174 ttl_category = TTL_MORE_THAN_ONE_WEEK; | 174 ttl_category = TTL_MORE_THAN_ONE_WEEK; |
|
fgorski
2014/09/25 03:37:34
Now that kMaximumTTL is less than a day, the last
juyik
2014/09/25 19:44:44
Done.
| |
| 175 else | 175 else |
| 176 ttl_category = TTL_MAXIMUM; | 176 ttl_category = TTL_MAXIMUM; |
| 177 | 177 |
| 178 UMA_HISTOGRAM_ENUMERATION("GCM.GCMOutgoingMessageTTLCategory", | 178 UMA_HISTOGRAM_ENUMERATION("GCM.OutgoingMessageTTL", |
| 179 ttl_category, | 179 ttl_category, |
| 180 TTL_CATEGORY_COUNT); | 180 TTL_CATEGORY_COUNT); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace | 183 } // namespace |
| 184 | 184 |
| 185 GCMInternalsBuilder::GCMInternalsBuilder() {} | 185 GCMInternalsBuilder::GCMInternalsBuilder() {} |
| 186 GCMInternalsBuilder::~GCMInternalsBuilder() {} | 186 GCMInternalsBuilder::~GCMInternalsBuilder() {} |
| 187 | 187 |
| 188 scoped_ptr<base::Clock> GCMInternalsBuilder::BuildClock() { | 188 scoped_ptr<base::Clock> GCMInternalsBuilder::BuildClock() { |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 953 | 953 |
| 954 recorder_.RecordIncomingSendError( | 954 recorder_.RecordIncomingSendError( |
| 955 data_message_stanza.category(), | 955 data_message_stanza.category(), |
| 956 data_message_stanza.to(), | 956 data_message_stanza.to(), |
| 957 data_message_stanza.id()); | 957 data_message_stanza.id()); |
| 958 delegate_->OnMessageSendError(data_message_stanza.category(), | 958 delegate_->OnMessageSendError(data_message_stanza.category(), |
| 959 send_error_details); | 959 send_error_details); |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace gcm | 962 } // namespace gcm |
| OLD | NEW |