summaryrefslogtreecommitdiffstats
path: root/sync/engine/sync_scheduler_impl.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-08 23:38:21 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-08 23:38:21 +0000
commit51e6efd247934b09cd531428411f6ed377e5665d (patch)
tree24286f252a2815997dadbb43972cee09f47ed64b /sync/engine/sync_scheduler_impl.cc
parenta39feb9e9cc9ac5c63e8a481aee6e8f8ef39c872 (diff)
downloadchromium_src-51e6efd247934b09cd531428411f6ed377e5665d.zip
chromium_src-51e6efd247934b09cd531428411f6ed377e5665d.tar.gz
chromium_src-51e6efd247934b09cd531428411f6ed377e5665d.tar.bz2
sync: Inject sync/'s dependency on invalidations
Defines an InvalidationInterface class and uses it to break any direct dependencies from sync code on syncer::Invalidation. Despite its name, syncer::Invalidation should belong solely to the invalidations component, which code in the sync/ directory should not depend on. Changes the interface in the sync engine from copying syncer::Invalidation to managing scoped_ptr<InvalidationInterface>. This change in memory management was required to support the use of an abstract interface. Removes the DroppedInvaldiationTracker. This class was previously only used by sync. The small benefit provided by this class is outweighed by the amount of glue code it would take to maintain it. Changes tests to conform to the new interface. Adds some test-only implementations of InvalidationInterface and some associated classes. BUG=259559 Review URL: https://codereview.chromium.org/322333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/sync_scheduler_impl.cc')
-rw-r--r--sync/engine/sync_scheduler_impl.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc
index 01a054a..c5629ba 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -387,16 +387,15 @@ void SyncSchedulerImpl::ScheduleLocalRefreshRequest(
void SyncSchedulerImpl::ScheduleInvalidationNudge(
const TimeDelta& desired_delay,
- const ObjectIdInvalidationMap& invalidation_map,
+ syncer::ModelType model_type,
+ scoped_ptr<InvalidationInterface> invalidation,
const tracked_objects::Location& nudge_location) {
DCHECK(CalledOnValidThread());
- DCHECK(!invalidation_map.Empty());
SDVLOG_LOC(nudge_location, 2)
<< "Scheduling sync because we received invalidation for "
- << ModelTypeSetToString(
- ObjectIdSetToModelTypeSet(invalidation_map.GetObjectIds()));
- nudge_tracker_.RecordRemoteInvalidation(invalidation_map);
+ << ModelTypeToString(model_type);
+ nudge_tracker_.RecordRemoteInvalidation(model_type, invalidation.Pass());
ScheduleNudgeImpl(desired_delay, nudge_location);
}