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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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.sender_id, | 109 recorder_.RecordDataMessageReceived(app_id, message.sender_id, |
110 message_byte_size); | 110 message_byte_size); |
111 | 111 |
112 DispatchMessage(app_id, message); | 112 DispatchMessage(app_id, message, |
113 base::Bind(&GCMDriverAndroid::SendMessageReceipt, | |
114 weak_ptr_factory_.GetWeakPtr())); | |
115 } | |
116 | |
117 void GCMDriverAndroid::DoSendMessageReceipt( | |
118 const MessageReceiptCallback& callback, | |
119 GCMMessageStatus status) { | |
120 // All of the GCMDriverAndroid calls run on the UI thread, so just run the | |
121 // callback directly. | |
122 callback.Run(status); | |
123 } | |
124 | |
125 void GCMDriverAndroid::SendMessageReceipt(GCMMessageStatus status) { | |
126 // TODO(harkness) Implement message receipts in android. crbug.com/674131. | |
127 NOTIMPLEMENTED(); | |
Peter Beverloo
2017/02/08 17:09:09
nit: drop the NOTIMPLEMENTED() -- that'll just spa
harkness
2017/02/09 16:27:30
Done.
| |
113 } | 128 } |
114 | 129 |
115 // static | 130 // static |
116 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) { | 131 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) { |
117 return RegisterNativesImpl(env); | 132 return RegisterNativesImpl(env); |
118 } | 133 } |
119 | 134 |
120 void GCMDriverAndroid::OnSignedIn() { | 135 void GCMDriverAndroid::OnSignedIn() { |
121 } | 136 } |
122 | 137 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 NOTIMPLEMENTED(); | 275 NOTIMPLEMENTED(); |
261 } | 276 } |
262 | 277 |
263 void GCMDriverAndroid::RecordDecryptionFailure( | 278 void GCMDriverAndroid::RecordDecryptionFailure( |
264 const std::string& app_id, | 279 const std::string& app_id, |
265 GCMEncryptionProvider::DecryptionResult result) { | 280 GCMEncryptionProvider::DecryptionResult result) { |
266 recorder_.RecordDecryptionFailure(app_id, result); | 281 recorder_.RecordDecryptionFailure(app_id, result); |
267 } | 282 } |
268 | 283 |
269 } // namespace gcm | 284 } // namespace gcm |
OLD | NEW |