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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 10702074: Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to HEAD 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 | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/syncapi_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 547dae8b2a200d8553bce3bbf819f71752e09db9..98ba4a3f178cc836a834075be75a45e77b7ff1d2 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -39,6 +39,7 @@
#include "sync/js/js_event_details.h"
#include "sync/js/js_event_handler.h"
#include "sync/js/js_reply_handler.h"
+#include "sync/notifier/invalidation_util.h"
#include "sync/notifier/notifications_disabled_reason.h"
#include "sync/notifier/sync_notifier.h"
#include "sync/protocol/encryption.pb.h"
@@ -481,8 +482,6 @@ bool SyncManagerImpl::Init(
if (!success)
return false;
- sync_notifier_->AddObserver(this);
-
return success;
}
@@ -725,7 +724,8 @@ void SyncManagerImpl::UpdateCredentials(
void SyncManagerImpl::UpdateEnabledTypes(
const ModelTypeSet& enabled_types) {
DCHECK(thread_checker_.CalledOnValidThread());
- sync_notifier_->UpdateEnabledTypes(enabled_types);
+ sync_notifier_->UpdateRegisteredIds(this,
+ ModelTypeSetToObjectIdSet(enabled_types));
}
void SyncManagerImpl::SetEncryptionPassphrase(
@@ -1195,7 +1195,7 @@ void SyncManagerImpl::ShutdownOnSyncThread() {
RemoveObserver(&debug_info_event_listener_);
if (sync_notifier_.get()) {
- sync_notifier_->RemoveObserver(this);
+ sync_notifier_->UpdateRegisteredIds(this, ObjectIdSet());
}
sync_notifier_.reset();
@@ -1781,9 +1781,11 @@ void SyncManagerImpl::OnNotificationsDisabled(
}
void SyncManagerImpl::OnIncomingNotification(
- const ModelTypePayloadMap& type_payloads,
+ const ObjectIdPayloadMap& id_payloads,
IncomingNotificationSource source) {
DCHECK(thread_checker_.CalledOnValidThread());
+ const ModelTypePayloadMap& type_payloads =
+ ObjectIdPayloadMapToModelTypePayloadMap(id_payloads);
if (source == LOCAL_NOTIFICATION) {
scheduler_->ScheduleNudgeWithPayloadsAsync(
TimeDelta::FromMilliseconds(kSyncRefreshDelayMsec),
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/syncapi_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698