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

Unified Diff: google_apis/gcm/base/mcs_util.cc

Issue 171683002: [GCM] Fix gcm login to properly identify chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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
« no previous file with comments | « google_apis/gcm/base/mcs_util.h ('k') | google_apis/gcm/base/mcs_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/base/mcs_util.cc
diff --git a/google_apis/gcm/base/mcs_util.cc b/google_apis/gcm/base/mcs_util.cc
index 54e1b29692ab3bacac5f410991db1068dbe54210..b578e573922e9ea93c86711c30a5e6a6ca564ada 100644
--- a/google_apis/gcm/base/mcs_util.cc
+++ b/google_apis/gcm/base/mcs_util.cc
@@ -39,8 +39,7 @@ const char* kProtoNames[] = {
COMPILE_ASSERT(arraysize(kProtoNames) == kNumProtoTypes,
ProtoNamesMustIncludeAllTags);
-// TODO(zea): replace these with proper values.
-const char kLoginId[] = "login-1";
+const char kLoginId[] = "chrome-";
const char kLoginDomain[] = "mcs.android.com";
const char kLoginDeviceIdPrefix[] = "android-";
const char kLoginSettingDefaultName[] = "new_vc";
@@ -51,8 +50,10 @@ const int kMaxTTLSeconds = 4 * 7 * 24 * 60 * 60; // 4 weeks.
} // namespace
-scoped_ptr<mcs_proto::LoginRequest> BuildLoginRequest(uint64 auth_id,
- uint64 auth_token) {
+scoped_ptr<mcs_proto::LoginRequest> BuildLoginRequest(
+ uint64 auth_id,
+ uint64 auth_token,
+ const std::string& version_string) {
// Create a hex encoded auth id for the device id field.
std::string auth_id_hex;
auth_id_hex = base::StringPrintf("%" PRIx64, auth_id);
@@ -63,12 +64,10 @@ scoped_ptr<mcs_proto::LoginRequest> BuildLoginRequest(uint64 auth_id,
scoped_ptr<mcs_proto::LoginRequest> login_request(
new mcs_proto::LoginRequest());
- // TODO(zea): set better values.
- login_request->set_account_id(1000000);
login_request->set_adaptive_heartbeat(false);
login_request->set_auth_service(mcs_proto::LoginRequest::ANDROID_ID);
login_request->set_auth_token(auth_token_str);
- login_request->set_id(kLoginId);
+ login_request->set_id(kLoginId + version_string);
login_request->set_domain(kLoginDomain);
login_request->set_device_id(kLoginDeviceIdPrefix + auth_id_hex);
login_request->set_network_type(1);
« no previous file with comments | « google_apis/gcm/base/mcs_util.h ('k') | google_apis/gcm/base/mcs_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698