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

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

Issue 1243563002: Teach the GCM Driver how to decrypt incoming messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-push-keys
Patch Set: address comment Created 5 years, 2 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
« no previous file with comments | « components/gcm_driver/gcm_driver.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 for (size_t i = 0; i + 1 < data_keys_and_values.size(); i += 2) { 81 for (size_t i = 0; i + 1 < data_keys_and_values.size(); i += 2) {
82 message.data[data_keys_and_values[i]] = data_keys_and_values[i+1]; 82 message.data[data_keys_and_values[i]] = data_keys_and_values[i+1];
83 } 83 }
84 // Convert j_raw_data from byte[] to binary std::string. 84 // Convert j_raw_data from byte[] to binary std::string.
85 if (j_raw_data) { 85 if (j_raw_data) {
86 std::vector<uint8_t> raw_data; 86 std::vector<uint8_t> raw_data;
87 JavaByteArrayToByteVector(env, j_raw_data, &raw_data); 87 JavaByteArrayToByteVector(env, j_raw_data, &raw_data);
88 message.raw_data.assign(raw_data.begin(), raw_data.end()); 88 message.raw_data.assign(raw_data.begin(), raw_data.end());
89 } 89 }
90 90
91 GetAppHandler(app_id)->OnMessage(app_id, message); 91 DispatchMessage(app_id, message);
92 } 92 }
93 93
94 void GCMDriverAndroid::OnMessagesDeleted(JNIEnv* env, 94 void GCMDriverAndroid::OnMessagesDeleted(JNIEnv* env,
95 jobject obj, 95 jobject obj,
96 jstring j_app_id) { 96 jstring j_app_id) {
97 std::string app_id = ConvertJavaStringToUTF8(env, j_app_id); 97 std::string app_id = ConvertJavaStringToUTF8(env, j_app_id);
98 98
99 GetAppHandler(app_id)->OnMessagesDeleted(app_id); 99 GetAppHandler(app_id)->OnMessagesDeleted(app_id);
100 } 100 }
101 101
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ConvertUTF8ToJavaString(env, sender_id).obj()); 213 ConvertUTF8ToJavaString(env, sender_id).obj());
214 } 214 }
215 215
216 void GCMDriverAndroid::SendImpl(const std::string& app_id, 216 void GCMDriverAndroid::SendImpl(const std::string& app_id,
217 const std::string& receiver_id, 217 const std::string& receiver_id,
218 const OutgoingMessage& message) { 218 const OutgoingMessage& message) {
219 NOTIMPLEMENTED(); 219 NOTIMPLEMENTED();
220 } 220 }
221 221
222 } // namespace gcm 222 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698