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

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

Issue 183923006: [GCM] API update to allow only a single sender in registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on CR. Changing how the senders/reg_ids are stored to avoid upgrade to multiple sedne… 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/registration_request.cc
diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc
index 3acd591f3d95cb97042055d4f94647fd1a368e1d..bed6ee91c7ae40bb1ae9979ad82cbbc88a25a662 100644
--- a/google_apis/gcm/engine/registration_request.cc
+++ b/google_apis/gcm/engine/registration_request.cc
@@ -33,9 +33,6 @@ const char kDeviceIdKey[] = "device";
const char kLoginHeader[] = "AidLogin";
const char kSenderKey[] = "sender";
-// Request validation constants.
-const size_t kMaxSenders = 100;
-
// Response constants.
const char kErrorPrefix[] = "Error=";
const char kTokenPrefix[] = "token=";
@@ -90,12 +87,12 @@ RegistrationRequest::RequestInfo::RequestInfo(
uint64 security_token,
const std::string& app_id,
const std::string& cert,
- const std::vector<std::string>& sender_ids)
+ const std::string& sender_id)
: android_id(android_id),
security_token(security_token),
app_id(app_id),
cert(cert),
- sender_ids(sender_ids) {
+ sender_id(sender_id) {
}
RegistrationRequest::RequestInfo::~RequestInfo() {}
@@ -122,8 +119,7 @@ void RegistrationRequest::Start() {
DCHECK(request_info_.android_id != 0UL);
DCHECK(request_info_.security_token != 0UL);
DCHECK(!request_info_.cert.empty());
- DCHECK(0 < request_info_.sender_ids.size() &&
- request_info_.sender_ids.size() <= kMaxSenders);
+ DCHECK(!request_info_.sender_id.empty());
DCHECK(!url_fetcher_.get());
url_fetcher_.reset(net::URLFetcher::Create(
@@ -141,18 +137,7 @@ void RegistrationRequest::Start() {
BuildFormEncoding(kAppIdKey, request_info_.app_id, &body);
BuildFormEncoding(kCertKey, request_info_.cert, &body);
BuildFormEncoding(kDeviceIdKey, android_id, &body);
-
- std::string senders;
- for (std::vector<std::string>::const_iterator iter =
- request_info_.sender_ids.begin();
- iter != request_info_.sender_ids.end();
- ++iter) {
- DCHECK(!iter->empty());
- if (!senders.empty())
- senders.append(",");
- senders.append(*iter);
- }
- BuildFormEncoding(kSenderKey, senders, &body);
+ BuildFormEncoding(kSenderKey, request_info_.sender_id, &body);
DVLOG(1) << "Performing registration for: " << request_info_.app_id;
DVLOG(1) << "Registration request: " << body;

Powered by Google App Engine
This is Rietveld 408576698