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

Unified Diff: sync/notifier/chrome_invalidation_client.cc

Issue 10836002: [Sync] Fix race condition with notification startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/chrome_invalidation_client.cc
diff --git a/sync/notifier/chrome_invalidation_client.cc b/sync/notifier/chrome_invalidation_client.cc
index 7b47fc52243810c0f46731a26ac66b4850ce8578..f0a3deea865561197d37f28fbfd02754571904f3 100644
--- a/sync/notifier/chrome_invalidation_client.cc
+++ b/sync/notifier/chrome_invalidation_client.cc
@@ -103,7 +103,10 @@ void ChromeInvalidationClient::UpdateCredentials(
void ChromeInvalidationClient::RegisterIds(const ObjectIdSet& ids) {
DCHECK(CalledOnValidThread());
registered_ids_ = ids;
- if (GetState() == NO_NOTIFICATION_ERROR && registration_manager_.get()) {
+ // |ticl_state_| can go to NO_NOTIFICATION_ERROR even without a
+ // working XMPP connection (as observed by us), so check it instead
+ // of GetState() (see http://crbug.com/139424).
+ if (ticl_state_ == NO_NOTIFICATION_ERROR && registration_manager_.get()) {
registration_manager_->SetRegisteredIds(registered_ids_);
}
// TODO(akalin): Clear invalidation versions for unregistered types.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698