summaryrefslogtreecommitdiffstats
path: root/sync/notifier/p2p_notifier.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 04:07:19 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 04:07:19 +0000
commit6529382867932acbf83e49bc107fbe4ea28ad311 (patch)
tree9baba790501b4c0e95b59ca72b5c769ca5a28190 /sync/notifier/p2p_notifier.h
parentbfe14502edd281a935198917fc49e30fbef47792 (diff)
downloadchromium_src-6529382867932acbf83e49bc107fbe4ea28ad311.zip
chromium_src-6529382867932acbf83e49bc107fbe4ea28ad311.tar.gz
chromium_src-6529382867932acbf83e49bc107fbe4ea28ad311.tar.bz2
[Sync] Avoid unregistering object IDs on shutdown
Add RegisterHandler() and UnregisterHandler(), which should be called before and after calls to UpdateRegisteredIds(). Use UnregisterHandler() on shutdown instead of UpdateRegisteredIds(_, ObjectIdSet()). Make SyncNotifierHelper non-thread-safe. Fix test breakages that this revealed. Also add GetAllRegisteredIds() instead of making it the return value of UpdateRegisteredIds(). Propagate UpdateRegisteredIds()/RegisterHandler()/UnregisterHandler() all the way up to ProfileSyncService. Make FakeSyncManager be created on the sync thread. Clean up SyncBackendHost startup/shutdown behavior a bit. BUG=140325 Review URL: https://chromiumcodereview.appspot.com/10824161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier/p2p_notifier.h')
-rw-r--r--sync/notifier/p2p_notifier.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sync/notifier/p2p_notifier.h b/sync/notifier/p2p_notifier.h
index d2de89d..4457c6f 100644
--- a/sync/notifier/p2p_notifier.h
+++ b/sync/notifier/p2p_notifier.h
@@ -20,7 +20,7 @@
#include "sync/internal_api/public/base/model_type.h"
#include "sync/notifier/notifications_disabled_reason.h"
#include "sync/notifier/sync_notifier.h"
-#include "sync/notifier/sync_notifier_helper.h"
+#include "sync/notifier/sync_notifier_registrar.h"
namespace notifier {
class PushClient;
@@ -96,8 +96,10 @@ class P2PNotifier : public SyncNotifier,
virtual ~P2PNotifier();
// SyncNotifier implementation
+ virtual void RegisterHandler(SyncNotifierObserver* handler) OVERRIDE;
virtual void UpdateRegisteredIds(SyncNotifierObserver* handler,
const ObjectIdSet& ids) OVERRIDE;
+ virtual void UnregisterHandler(SyncNotifierObserver* handler) OVERRIDE;
virtual void SetUniqueId(const std::string& unique_id) OVERRIDE;
virtual void SetStateDeprecated(const std::string& state) OVERRIDE;
virtual void UpdateCredentials(
@@ -119,7 +121,7 @@ class P2PNotifier : public SyncNotifier,
base::ThreadChecker thread_checker_;
- SyncNotifierHelper helper_;
+ SyncNotifierRegistrar registrar_;
// The push client.
scoped_ptr<notifier::PushClient> push_client_;