diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 20:19:47 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 20:19:47 +0000 |
commit | 1ce107fc44a5c1d3d92ad01bead09be8e8b2acad (patch) | |
tree | cefc841bebb19c1dcc3b726005d0deb98f29fa9b | |
parent | ed8838e4d87055ae3faf24cee8458abb61f46b1e (diff) | |
download | chromium_src-1ce107fc44a5c1d3d92ad01bead09be8e8b2acad.zip chromium_src-1ce107fc44a5c1d3d92ad01bead09be8e8b2acad.tar.gz chromium_src-1ce107fc44a5c1d3d92ad01bead09be8e8b2acad.tar.bz2 |
[Sync] Fixed spurious warning being generated on registration loss
BUG=None
TEST=Manual
Review URL: http://codereview.chromium.org/6020009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69972 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/notifier/chrome_invalidation_client.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.cc b/chrome/browser/sync/notifier/chrome_invalidation_client.cc index 29fd987..4a84d3d 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.cc +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.cc @@ -149,20 +149,24 @@ void ChromeInvalidationClient::RegistrationStateChanged( invalidation::RegistrationState new_state, const invalidation::UnknownHint& unknown_hint) { DCHECK(non_thread_safe_.CalledOnValidThread()); - VLOG(1) << "RegistrationStateChanged to " << new_state; + VLOG(1) << "RegistrationStateChanged: " + << ObjectIdToString(object_id) << " " << new_state; if (new_state == invalidation::RegistrationState_UNKNOWN) { VLOG(1) << "is_transient=" << unknown_hint.is_transient() << ", message=" << unknown_hint.message(); } - // TODO(akalin): Figure out something else to do if the failure - // isn't transient. Even if it is transient, we may still want to - // add exponential back-off or limit the number of attempts. + syncable::ModelType model_type; - if (ObjectIdToRealModelType(object_id, &model_type) && - (new_state != invalidation::RegistrationState_REGISTERED)) { - registration_manager_->MarkRegistrationLost(model_type); - } else { + if (!ObjectIdToRealModelType(object_id, &model_type)) { LOG(WARNING) << "Could not get object id model type; ignoring"; + return; + } + + if (new_state != invalidation::RegistrationState_REGISTERED) { + // TODO(akalin): Figure out something else to do if the failure + // isn't transient. Even if it is transient, we may still want to + // add exponential back-off or limit the number of attempts. + registration_manager_->MarkRegistrationLost(model_type); } } |