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

Side by Side Diff: sync/internal_api/sync_manager_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/internal_api/sync_manager_impl.h" 5 #include "sync/internal_api/sync_manager_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 // TODO(lipalani) : Calculate the nudge delay based on all types. 890 // TODO(lipalani) : Calculate the nudge delay based on all types.
891 base::TimeDelta nudge_delay = NudgeStrategy::GetNudgeDelayTimeDelta( 891 base::TimeDelta nudge_delay = NudgeStrategy::GetNudgeDelayTimeDelta(
892 types.First().Get(), 892 types.First().Get(),
893 this); 893 this);
894 scheduler_->ScheduleLocalNudge(nudge_delay, 894 scheduler_->ScheduleLocalNudge(nudge_delay,
895 types, 895 types,
896 nudge_location); 896 nudge_location);
897 } 897 }
898 898
899 void SyncManagerImpl::NudgeForInitialDownload(syncer::ModelType type) { 899 void SyncManagerImpl::NudgeForInitialDownload(syncer::ModelType type) {
900 // TODO(rlarocque): Initial downloads should have a separate nudge type.
901 DCHECK(thread_checker_.CalledOnValidThread()); 900 DCHECK(thread_checker_.CalledOnValidThread());
902 RefreshTypes(ModelTypeSet(type)); 901 scheduler_->ScheduleInitialSyncNudge(type);
903 } 902 }
904 903
905 void SyncManagerImpl::NudgeForCommit(syncer::ModelType type) { 904 void SyncManagerImpl::NudgeForCommit(syncer::ModelType type) {
906 DCHECK(thread_checker_.CalledOnValidThread()); 905 DCHECK(thread_checker_.CalledOnValidThread());
907 RequestNudgeForDataTypes(FROM_HERE, ModelTypeSet(type)); 906 RequestNudgeForDataTypes(FROM_HERE, ModelTypeSet(type));
908 } 907 }
909 908
910 void SyncManagerImpl::NudgeForRefresh(syncer::ModelType type) { 909 void SyncManagerImpl::NudgeForRefresh(syncer::ModelType type) {
911 DCHECK(thread_checker_.CalledOnValidThread()); 910 DCHECK(thread_checker_.CalledOnValidThread());
912 RefreshTypes(ModelTypeSet(type)); 911 RefreshTypes(ModelTypeSet(type));
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 int SyncManagerImpl::GetDefaultNudgeDelay() { 1143 int SyncManagerImpl::GetDefaultNudgeDelay() {
1145 return kDefaultNudgeDelayMilliseconds; 1144 return kDefaultNudgeDelayMilliseconds;
1146 } 1145 }
1147 1146
1148 // static. 1147 // static.
1149 int SyncManagerImpl::GetPreferencesNudgeDelay() { 1148 int SyncManagerImpl::GetPreferencesNudgeDelay() {
1150 return kPreferencesNudgeDelayMilliseconds; 1149 return kPreferencesNudgeDelayMilliseconds;
1151 } 1150 }
1152 1151
1153 } // namespace syncer 1152 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698