OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "components/gcm_driver/gcm_stats_recorder_android.h" | 7 #include "components/gcm_driver/gcm_stats_recorder_android.h" |
8 | 8 |
9 namespace gcm { | 9 namespace gcm { |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 receiving_activities_.push_front(activity); | 116 receiving_activities_.push_front(activity); |
117 if (receiving_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) | 117 if (receiving_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) |
118 receiving_activities_.pop_back(); | 118 receiving_activities_.pop_back(); |
119 | 119 |
120 if (delegate_) | 120 if (delegate_) |
121 delegate_->OnActivityRecorded(); | 121 delegate_->OnActivityRecorded(); |
122 } | 122 } |
123 | 123 |
124 void GCMStatsRecorderAndroid::RecordDecryptionFailure( | 124 void GCMStatsRecorderAndroid::RecordDecryptionFailure( |
125 const std::string& app_id, | 125 const std::string& app_id, |
126 GCMEncryptionProvider::DecryptionFailure reason) { | 126 GCMEncryptionProvider::DecryptionResult result) { |
| 127 DCHECK_NE(result, GCMEncryptionProvider::DECRYPTION_RESULT_UNENCRYPTED); |
| 128 DCHECK_NE(result, GCMEncryptionProvider::DECRYPTION_RESULT_DECRYPTED); |
127 if (!is_recording_) | 129 if (!is_recording_) |
128 return; | 130 return; |
129 | 131 |
130 DecryptionFailureActivity activity; | 132 DecryptionFailureActivity activity; |
131 activity.app_id = app_id; | 133 activity.app_id = app_id; |
132 activity.details = | 134 activity.details = |
133 GCMEncryptionProvider::ToDecryptionFailureDetailsString(reason); | 135 GCMEncryptionProvider::ToDecryptionResultDetailsString(result); |
134 | 136 |
135 decryption_failure_activities_.push_front(activity); | 137 decryption_failure_activities_.push_front(activity); |
136 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) | 138 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) |
137 decryption_failure_activities_.pop_back(); | 139 decryption_failure_activities_.pop_back(); |
138 | 140 |
139 if (delegate_) | 141 if (delegate_) |
140 delegate_->OnActivityRecorded(); | 142 delegate_->OnActivityRecorded(); |
141 } | 143 } |
142 | 144 |
143 } // namespace gcm | 145 } // namespace gcm |
OLD | NEW |