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_driver_android.h" | 5 #include "components/gcm_driver/gcm_driver_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 // Convert j_raw_data from byte[] to binary std::string. | 100 // Convert j_raw_data from byte[] to binary std::string. |
101 if (j_raw_data) { | 101 if (j_raw_data) { |
102 std::vector<uint8_t> raw_data; | 102 std::vector<uint8_t> raw_data; |
103 JavaByteArrayToByteVector(env, j_raw_data, &raw_data); | 103 JavaByteArrayToByteVector(env, j_raw_data, &raw_data); |
104 message.raw_data.assign(raw_data.begin(), raw_data.end()); | 104 message.raw_data.assign(raw_data.begin(), raw_data.end()); |
105 | 105 |
106 message_byte_size += message.raw_data.size(); | 106 message_byte_size += message.raw_data.size(); |
107 } | 107 } |
108 | 108 |
109 recorder_.RecordDataMessageReceived(app_id, message_byte_size); | 109 recorder_.RecordDataMessageReceived(app_id, message.sender_id, |
| 110 message_byte_size); |
110 | 111 |
111 DispatchMessage(app_id, message); | 112 DispatchMessage(app_id, message); |
112 } | 113 } |
113 | 114 |
114 // static | 115 // static |
115 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) { | 116 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) { |
116 return RegisterNativesImpl(env); | 117 return RegisterNativesImpl(env); |
117 } | 118 } |
118 | 119 |
119 void GCMDriverAndroid::OnSignedIn() { | 120 void GCMDriverAndroid::OnSignedIn() { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 NOTIMPLEMENTED(); | 260 NOTIMPLEMENTED(); |
260 } | 261 } |
261 | 262 |
262 void GCMDriverAndroid::RecordDecryptionFailure( | 263 void GCMDriverAndroid::RecordDecryptionFailure( |
263 const std::string& app_id, | 264 const std::string& app_id, |
264 GCMEncryptionProvider::DecryptionResult result) { | 265 GCMEncryptionProvider::DecryptionResult result) { |
265 recorder_.RecordDecryptionFailure(app_id, result); | 266 recorder_.RecordDecryptionFailure(app_id, result); |
266 } | 267 } |
267 | 268 |
268 } // namespace gcm | 269 } // namespace gcm |
OLD | NEW |