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

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

Issue 387983004: sync: Support non-blocking initial sync in proto (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix comment 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
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 const tracked_objects::Location& nudge_location) { 391 const tracked_objects::Location& nudge_location) {
392 DCHECK(CalledOnValidThread()); 392 DCHECK(CalledOnValidThread());
393 393
394 SDVLOG_LOC(nudge_location, 2) 394 SDVLOG_LOC(nudge_location, 2)
395 << "Scheduling sync because we received invalidation for " 395 << "Scheduling sync because we received invalidation for "
396 << ModelTypeToString(model_type); 396 << ModelTypeToString(model_type);
397 nudge_tracker_.RecordRemoteInvalidation(model_type, invalidation.Pass()); 397 nudge_tracker_.RecordRemoteInvalidation(model_type, invalidation.Pass());
398 ScheduleNudgeImpl(desired_delay, nudge_location); 398 ScheduleNudgeImpl(desired_delay, nudge_location);
399 } 399 }
400 400
401 void SyncSchedulerImpl::ScheduleInitialSyncNudge(syncer::ModelType model_type) {
stanisc 2014/07/17 18:46:10 This is called ScheduleInitialSyncNudge. Does the
rlarocque 2014/07/17 18:58:06 It should be very uncommon that it gets called mor
402 DCHECK(CalledOnValidThread());
403
404 SDVLOG(2) << "Scheduling non-blocking initial sync for "
405 << ModelTypeToString(model_type);
406 nudge_tracker_.RecordInitialSyncRequired(model_type);
407 ScheduleNudgeImpl(TimeDelta::FromSeconds(0), FROM_HERE);
408 }
409
401 // TODO(zea): Consider adding separate throttling/backoff for datatype 410 // TODO(zea): Consider adding separate throttling/backoff for datatype
402 // refresh requests. 411 // refresh requests.
403 void SyncSchedulerImpl::ScheduleNudgeImpl( 412 void SyncSchedulerImpl::ScheduleNudgeImpl(
404 const TimeDelta& delay, 413 const TimeDelta& delay,
405 const tracked_objects::Location& nudge_location) { 414 const tracked_objects::Location& nudge_location) {
406 DCHECK(CalledOnValidThread()); 415 DCHECK(CalledOnValidThread());
407 416
408 if (no_scheduling_allowed_) { 417 if (no_scheduling_allowed_) {
409 NOTREACHED() << "Illegal to schedule job while session in progress."; 418 NOTREACHED() << "Illegal to schedule job while session in progress.";
410 return; 419 return;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 918
910 #undef SDVLOG_LOC 919 #undef SDVLOG_LOC
911 920
912 #undef SDVLOG 921 #undef SDVLOG
913 922
914 #undef SLOG 923 #undef SLOG
915 924
916 #undef ENUM_CASE 925 #undef ENUM_CASE
917 926
918 } // namespace syncer 927 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698