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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 registration_activities_.push_front(activity); | 97 registration_activities_.push_front(activity); |
98 if (registration_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) | 98 if (registration_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) |
99 registration_activities_.pop_back(); | 99 registration_activities_.pop_back(); |
100 | 100 |
101 if (delegate_) | 101 if (delegate_) |
102 delegate_->OnActivityRecorded(); | 102 delegate_->OnActivityRecorded(); |
103 } | 103 } |
104 | 104 |
105 void GCMStatsRecorderAndroid::RecordDataMessageReceived( | 105 void GCMStatsRecorderAndroid::RecordDataMessageReceived( |
106 const std::string& app_id, | 106 const std::string& app_id, |
| 107 const std::string& from, |
107 int message_byte_size) { | 108 int message_byte_size) { |
108 if (!is_recording_) | 109 if (!is_recording_) |
109 return; | 110 return; |
110 | 111 |
111 ReceivingActivity activity; | 112 ReceivingActivity activity; |
112 activity.app_id = app_id; | 113 activity.app_id = app_id; |
| 114 activity.from = from; |
113 activity.message_byte_size = message_byte_size; | 115 activity.message_byte_size = message_byte_size; |
114 activity.event = "Data msg received"; | 116 activity.event = "Data msg received"; |
115 | 117 |
116 receiving_activities_.push_front(activity); | 118 receiving_activities_.push_front(activity); |
117 if (receiving_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) | 119 if (receiving_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) |
118 receiving_activities_.pop_back(); | 120 receiving_activities_.pop_back(); |
119 | 121 |
120 if (delegate_) | 122 if (delegate_) |
121 delegate_->OnActivityRecorded(); | 123 delegate_->OnActivityRecorded(); |
122 } | 124 } |
(...skipping 13 matching lines...) Expand all Loading... |
136 | 138 |
137 decryption_failure_activities_.push_front(activity); | 139 decryption_failure_activities_.push_front(activity); |
138 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) | 140 if (decryption_failure_activities_.size() > MAX_LOGGED_ACTIVITY_COUNT) |
139 decryption_failure_activities_.pop_back(); | 141 decryption_failure_activities_.pop_back(); |
140 | 142 |
141 if (delegate_) | 143 if (delegate_) |
142 delegate_->OnActivityRecorded(); | 144 delegate_->OnActivityRecorded(); |
143 } | 145 } |
144 | 146 |
145 } // namespace gcm | 147 } // namespace gcm |
OLD | NEW |