Author:
aka...@chromium.org
Date: Wed Aug 1 11:00:06 2012
New Revision: 149443
Log:
Merge 148907 - [Sync] Fix race condition with notification startup
This fixes a race condition which may cause notifications to not work
on startup.
This is a minimal change for ease of merging. Unit tests will be landed
in a separate patch.
BUG=139424
Review URL:
https://chromiumcodereview.appspot.com/10836002
TBR=
aka...@chromium.org
Review URL:
https://chromiumcodereview.appspot.com/10828116
Modified:
branches/1180/src/sync/notifier/chrome_invalidation_client.cc
Modified: branches/1180/src/sync/notifier/chrome_invalidation_client.cc
==============================================================================
--- branches/1180/src/sync/notifier/chrome_invalidation_client.cc (original)
+++ branches/1180/src/sync/notifier/chrome_invalidation_client.cc Wed Aug 1 11:00:06 2012
@@ -105,7 +105,10 @@
void ChromeInvalidationClient::RegisterTypes(syncable::ModelTypeSet types) {
DCHECK(CalledOnValidThread());
registered_types_ = types;
- 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_->SetRegisteredTypes(registered_types_);
}
// TODO(akalin): Clear invalidation versions for unregistered types.