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

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

Issue 378643002: [GCM] Check-in with signed in accounts associates device to user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing compilation issue on android Created 6 years, 5 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 a5558471772a4043bbc0a5753d3d685678e0a6a1..5600a1c35386f0375e06552674fd970a5f2fc831 100644
--- a/google_apis/gcm/engine/checkin_request.cc
+++ b/google_apis/gcm/engine/checkin_request.cc
@@ -80,10 +80,12 @@ void RecordCheckinStatusAndReportUMA(CheckinRequestStatus status,
CheckinRequest::RequestInfo::RequestInfo(
uint64 android_id,
uint64 security_token,
+ const std::map<std::string, std::string> account_tokens,
const std::string& settings_digest,
const checkin_proto::ChromeBuildProto& chrome_build_proto)
: android_id(android_id),
security_token(security_token),
+ account_tokens(account_tokens),
settings_digest(settings_digest),
chrome_build_proto(chrome_build_proto) {
}
@@ -127,6 +129,16 @@ void CheckinRequest::Start() {
checkin->set_type(checkin_proto::DEVICE_CHROME_BROWSER);
#endif
+ // Pack a map of email -> token mappings into a repeated field, where odd
+ // entries are email addresses, while even ones are respective OAuth2 tokens.
+ for (std::map<std::string, std::string>::const_iterator iter =
+ request_info_.account_tokens.begin();
+ iter != request_info_.account_tokens.end();
+ ++iter) {
+ request.add_account_cookie(iter->first);
+ request.add_account_cookie(iter->second);
+ }
+
std::string upload_data;
CHECK(request.SerializeToString(&upload_data));

Powered by Google App Engine
This is Rietveld 408576698