summaryrefslogtreecommitdiffstats
path: root/google_apis/gcm/engine/checkin_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'google_apis/gcm/engine/checkin_request.cc')
-rw-r--r--google_apis/gcm/engine/checkin_request.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/google_apis/gcm/engine/checkin_request.cc b/google_apis/gcm/engine/checkin_request.cc
index a555847..8ba65ad 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));