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

Side by Side Diff: sync/engine/sync_scheduler_impl.cc

Issue 322333004: sync: Inject sync/'s dependency on invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/engine/sync_scheduler_impl.h" 5 #include "sync/engine/sync_scheduler_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 SDVLOG_LOC(nudge_location, 2) 381 SDVLOG_LOC(nudge_location, 2)
382 << "Scheduling sync because of local refresh request for " 382 << "Scheduling sync because of local refresh request for "
383 << ModelTypeSetToString(types); 383 << ModelTypeSetToString(types);
384 nudge_tracker_.RecordLocalRefreshRequest(types); 384 nudge_tracker_.RecordLocalRefreshRequest(types);
385 ScheduleNudgeImpl(desired_delay, nudge_location); 385 ScheduleNudgeImpl(desired_delay, nudge_location);
386 } 386 }
387 387
388 void SyncSchedulerImpl::ScheduleInvalidationNudge( 388 void SyncSchedulerImpl::ScheduleInvalidationNudge(
389 const TimeDelta& desired_delay, 389 const TimeDelta& desired_delay,
390 const ObjectIdInvalidationMap& invalidation_map, 390 syncer::ModelType model_type,
391 scoped_ptr<InvalidationInterface> invalidation,
391 const tracked_objects::Location& nudge_location) { 392 const tracked_objects::Location& nudge_location) {
392 DCHECK(CalledOnValidThread()); 393 DCHECK(CalledOnValidThread());
393 DCHECK(!invalidation_map.Empty());
394 394
395 SDVLOG_LOC(nudge_location, 2) 395 SDVLOG_LOC(nudge_location, 2)
396 << "Scheduling sync because we received invalidation for " 396 << "Scheduling sync because we received invalidation for "
397 << ModelTypeSetToString( 397 << ModelTypeToString(model_type);
398 ObjectIdSetToModelTypeSet(invalidation_map.GetObjectIds())); 398 nudge_tracker_.RecordRemoteInvalidation(model_type, invalidation.Pass());
399 nudge_tracker_.RecordRemoteInvalidation(invalidation_map);
400 ScheduleNudgeImpl(desired_delay, nudge_location); 399 ScheduleNudgeImpl(desired_delay, nudge_location);
401 } 400 }
402 401
403 // TODO(zea): Consider adding separate throttling/backoff for datatype 402 // TODO(zea): Consider adding separate throttling/backoff for datatype
404 // refresh requests. 403 // refresh requests.
405 void SyncSchedulerImpl::ScheduleNudgeImpl( 404 void SyncSchedulerImpl::ScheduleNudgeImpl(
406 const TimeDelta& delay, 405 const TimeDelta& delay,
407 const tracked_objects::Location& nudge_location) { 406 const tracked_objects::Location& nudge_location) {
408 DCHECK(CalledOnValidThread()); 407 DCHECK(CalledOnValidThread());
409 408
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 910
912 #undef SDVLOG_LOC 911 #undef SDVLOG_LOC
913 912
914 #undef SDVLOG 913 #undef SDVLOG
915 914
916 #undef SLOG 915 #undef SLOG
917 916
918 #undef ENUM_CASE 917 #undef ENUM_CASE
919 918
920 } // namespace syncer 919 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698