| Index: components/gcm_driver/registration_info.cc
|
| diff --git a/components/gcm_driver/registration_info.cc b/components/gcm_driver/registration_info.cc
|
| index c91d1ccfabdaa92ea67262b9d78290566cd37b91..84ca33d37c42b9fbb1dba28b2e239b0c5ba543ce 100644
|
| --- a/components/gcm_driver/registration_info.cc
|
| +++ b/components/gcm_driver/registration_info.cc
|
| @@ -12,9 +12,9 @@
|
| namespace gcm {
|
|
|
| namespace {
|
| -const char kInsanceIDSerializationPrefix[] = "iid-";
|
| -const int kInsanceIDSerializationPrefixLength =
|
| - sizeof(kInsanceIDSerializationPrefix) / sizeof(char) - 1;
|
| +const char kInstanceIDSerializationPrefix[] = "iid-";
|
| +const int kInstanceIDSerializationPrefixLength =
|
| + sizeof(kInstanceIDSerializationPrefix) / sizeof(char) - 1;
|
| } // namespace
|
|
|
| // static
|
| @@ -24,7 +24,7 @@ std::unique_ptr<RegistrationInfo> RegistrationInfo::BuildFromString(
|
| std::string* registration_id) {
|
| std::unique_ptr<RegistrationInfo> registration;
|
|
|
| - if (base::StartsWith(serialized_key, kInsanceIDSerializationPrefix,
|
| + if (base::StartsWith(serialized_key, kInstanceIDSerializationPrefix,
|
| base::CompareCase::SENSITIVE))
|
| registration.reset(new InstanceIDTokenInfo);
|
| else
|
| @@ -158,14 +158,15 @@ RegistrationInfo::RegistrationType InstanceIDTokenInfo::GetType() const {
|
| }
|
|
|
| std::string InstanceIDTokenInfo::GetSerializedKey() const {
|
| - DCHECK(authorized_entity.find(',') == std::string::npos &&
|
| + DCHECK(app_id.find(',') == std::string::npos &&
|
| + authorized_entity.find(',') == std::string::npos &&
|
| scope.find(',') == std::string::npos);
|
|
|
| // Multiple registrations are supported for Instance ID. So the key is based
|
| // on the combination of (app_id, authorized_entity, scope).
|
|
|
| // Adds a prefix to differentiate easily with GCM registration key.
|
| - std::string key(kInsanceIDSerializationPrefix);
|
| + std::string key(kInstanceIDSerializationPrefix);
|
| key += app_id;
|
| key += ",";
|
| key += authorized_entity;
|
| @@ -186,13 +187,13 @@ bool InstanceIDTokenInfo::Deserialize(
|
| if (serialized_key.empty() || serialized_value.empty())
|
| return false;
|
|
|
| - if (!base::StartsWith(serialized_key, kInsanceIDSerializationPrefix,
|
| + if (!base::StartsWith(serialized_key, kInstanceIDSerializationPrefix,
|
| base::CompareCase::SENSITIVE))
|
| return false;
|
|
|
| std::vector<std::string> fields = base::SplitString(
|
| - serialized_key.substr(kInsanceIDSerializationPrefixLength),
|
| - ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
| + serialized_key.substr(kInstanceIDSerializationPrefixLength), ",",
|
| + base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
| if (fields.size() != 3 || fields[0].empty() ||
|
| fields[1].empty() || fields[2].empty()) {
|
| return false;
|
| @@ -214,7 +215,7 @@ bool RegistrationInfoComparer::operator()(
|
| DCHECK(a.get() && b.get());
|
|
|
| // For GCMRegistrationInfo, the comparison is based on app_id only.
|
| - // For InstanceIDTokenInfo, the comparison is bsaed on
|
| + // For InstanceIDTokenInfo, the comparison is based on
|
| // <app_id, authorized_entity, scope>.
|
| if (a->app_id < b->app_id)
|
| return true;
|
|
|