diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 05:03:28 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 05:03:28 +0000 |
commit | 002ca0edbf91a24670bcbc55ec7a40559f8f67ff (patch) | |
tree | 398d70e7ea008e18719aeb886a3daf04861df192 | |
parent | 63cd30f5d6354a5b3008530cb3aaaf72ef60f053 (diff) | |
download | chromium_src-002ca0edbf91a24670bcbc55ec7a40559f8f67ff.zip chromium_src-002ca0edbf91a24670bcbc55ec7a40559f8f67ff.tar.gz chromium_src-002ca0edbf91a24670bcbc55ec7a40559f8f67ff.tar.bz2 |
Nudge syncer thread when notifications are enabled.
Several sync integration tests were failing because the fact that
notifications were enabled was not detected by the sync clients. This
changelist adds a call to NudgeSyncer() in OnNotificationStateChange()
so that the syncer thread is made aware of the fact that notifications
have been enabled. This change caused the integration test pass rate to
increase from ~20% to 90+%.
BUG=47240
TEST=sync_integration_tests
Review URL: http://codereview.chromium.org/2814045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51341 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/engine/syncapi.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index b388042..f5659e0 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -1992,6 +1992,14 @@ void SyncManager::SyncInternal::OnNotificationStateChange( } if ((notification_method_ != browser_sync::NOTIFICATION_SERVER) && notifications_enabled) { + // Nudge the syncer thread when notifications are enabled, in case there is + // any data that has not yet been synced. If we are listening to + // server-issued notifications, we are already guaranteed to receive a + // notification on a successful connection. + if (syncer_thread()) { + syncer_thread()->NudgeSyncer(0, SyncerThread::kLocal); + } + // Send a notification as soon as subscriptions are on // (see http://code.google.com/p/chromium/issues/detail?id=38563 ). core_message_loop_->PostTask( |