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

Unified Diff: google_apis/gcm/engine/checkin_request.cc

Issue 171513004: [GCM] Adding a list of accounts present on the client to checkin request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding documentation of the parameter of GCMClient.Initialize(...account_ids...) Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: google_apis/gcm/engine/checkin_request.cc
diff --git a/google_apis/gcm/engine/checkin_request.cc b/google_apis/gcm/engine/checkin_request.cc
index 5e55f1561bca5b1aa2a170436313ecf7af51e771..94a6fc9e38ac8d8d27f9a7cdd0c69f5cd413695b 100644
--- a/google_apis/gcm/engine/checkin_request.cc
+++ b/google_apis/gcm/engine/checkin_request.cc
@@ -52,6 +52,7 @@ CheckinRequest::CheckinRequest(
const checkin_proto::ChromeBuildProto& chrome_build_proto,
uint64 android_id,
uint64 security_token,
+ const std::vector<std::string>& account_ids,
net::URLRequestContextGetter* request_context_getter)
: request_context_getter_(request_context_getter),
callback_(callback),
@@ -59,6 +60,7 @@ CheckinRequest::CheckinRequest(
chrome_build_proto_(chrome_build_proto),
android_id_(android_id),
security_token_(security_token),
+ account_ids_(account_ids),
weak_ptr_factory_(this) {
}
@@ -81,6 +83,12 @@ void CheckinRequest::Start() {
checkin->set_type(checkin_proto::DEVICE_CHROME_BROWSER);
#endif
+ for (std::vector<std::string>::const_iterator iter = account_ids_.begin();
+ iter != account_ids_.end();
+ ++iter) {
+ request.add_account_cookie("[" + *iter + "]");
+ }
+
std::string upload_data;
CHECK(request.SerializeToString(&upload_data));

Powered by Google App Engine
This is Rietveld 408576698