Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: components/gcm_driver/gcm_driver_android.cc

Issue 2578583002: Provide a mechanism for the GCM driver to send message receipts to GCM.
Patch Set: Adding new file I missed previously. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
Peter Beverloo 2017/01/13 01:46:12 Why isn't this BindToCurrentThread? If we're telli
harkness 2017/01/19 13:20:42 Done.
114 weak_ptr_factory_.GetWeakPtr(), app_id, ""));
Peter Beverloo 2017/01/13 01:46:12 Why the empty string for |message_id|? Can we just
harkness 2017/01/19 13:20:42 Sure, that's a good idea. Done.
115 }
116
117 void GCMDriverAndroid::SendMessageReceipt(const std::string& app_id,
118 const std::string& message_id,
119 GCMMessageStatus status) {
120 // TODO(harkness) Implement message receipts in android.
Peter Beverloo 2017/01/13 01:46:12 nit: please mention a bug
harkness 2017/01/19 13:20:42 Done.
121 NOTIMPLEMENTED();
113 } 122 }
114 123
115 // static 124 // static
116 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) { 125 bool GCMDriverAndroid::RegisterJni(JNIEnv* env) {
117 return RegisterNativesImpl(env); 126 return RegisterNativesImpl(env);
118 } 127 }
119 128
120 void GCMDriverAndroid::OnSignedIn() { 129 void GCMDriverAndroid::OnSignedIn() {
121 } 130 }
122 131
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 NOTIMPLEMENTED(); 269 NOTIMPLEMENTED();
261 } 270 }
262 271
263 void GCMDriverAndroid::RecordDecryptionFailure( 272 void GCMDriverAndroid::RecordDecryptionFailure(
264 const std::string& app_id, 273 const std::string& app_id,
265 GCMEncryptionProvider::DecryptionResult result) { 274 GCMEncryptionProvider::DecryptionResult result) {
266 recorder_.RecordDecryptionFailure(app_id, result); 275 recorder_.RecordDecryptionFailure(app_id, result);
267 } 276 }
268 277
269 } // namespace gcm 278 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698