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

Side by Side Diff: components/sync/engine_impl/sync_scheduler_impl.cc

Issue 2376123003: [Sync] Move //components/sync to the syncer namespace. (Closed)
Patch Set: Fix tools and iOS. Created 4 years, 2 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
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 "components/sync/engine_impl/sync_scheduler_impl.h" 5 #include "components/sync/engine_impl/sync_scheduler_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 DCHECK(!types.Empty()); 406 DCHECK(!types.Empty());
407 407
408 SDVLOG_LOC(nudge_location, 2) 408 SDVLOG_LOC(nudge_location, 2)
409 << "Scheduling sync because of local refresh request for " 409 << "Scheduling sync because of local refresh request for "
410 << ModelTypeSetToString(types); 410 << ModelTypeSetToString(types);
411 base::TimeDelta nudge_delay = nudge_tracker_.RecordLocalRefreshRequest(types); 411 base::TimeDelta nudge_delay = nudge_tracker_.RecordLocalRefreshRequest(types);
412 ScheduleNudgeImpl(nudge_delay, nudge_location); 412 ScheduleNudgeImpl(nudge_delay, nudge_location);
413 } 413 }
414 414
415 void SyncSchedulerImpl::ScheduleInvalidationNudge( 415 void SyncSchedulerImpl::ScheduleInvalidationNudge(
416 syncer::ModelType model_type, 416 ModelType model_type,
417 std::unique_ptr<InvalidationInterface> invalidation, 417 std::unique_ptr<InvalidationInterface> invalidation,
418 const tracked_objects::Location& nudge_location) { 418 const tracked_objects::Location& nudge_location) {
419 DCHECK(CalledOnValidThread()); 419 DCHECK(CalledOnValidThread());
420 420
421 SDVLOG_LOC(nudge_location, 2) 421 SDVLOG_LOC(nudge_location, 2)
422 << "Scheduling sync because we received invalidation for " 422 << "Scheduling sync because we received invalidation for "
423 << ModelTypeToString(model_type); 423 << ModelTypeToString(model_type);
424 base::TimeDelta nudge_delay = nudge_tracker_.RecordRemoteInvalidation( 424 base::TimeDelta nudge_delay = nudge_tracker_.RecordRemoteInvalidation(
425 model_type, std::move(invalidation)); 425 model_type, std::move(invalidation));
426 ScheduleNudgeImpl(nudge_delay, nudge_location); 426 ScheduleNudgeImpl(nudge_delay, nudge_location);
427 } 427 }
428 428
429 void SyncSchedulerImpl::ScheduleInitialSyncNudge(syncer::ModelType model_type) { 429 void SyncSchedulerImpl::ScheduleInitialSyncNudge(ModelType model_type) {
430 DCHECK(CalledOnValidThread()); 430 DCHECK(CalledOnValidThread());
431 431
432 SDVLOG(2) << "Scheduling non-blocking initial sync for " 432 SDVLOG(2) << "Scheduling non-blocking initial sync for "
433 << ModelTypeToString(model_type); 433 << ModelTypeToString(model_type);
434 nudge_tracker_.RecordInitialSyncRequired(model_type); 434 nudge_tracker_.RecordInitialSyncRequired(model_type);
435 ScheduleNudgeImpl(TimeDelta::FromSeconds(0), FROM_HERE); 435 ScheduleNudgeImpl(TimeDelta::FromSeconds(0), FROM_HERE);
436 } 436 }
437 437
438 // TODO(zea): Consider adding separate throttling/backoff for datatype 438 // TODO(zea): Consider adding separate throttling/backoff for datatype
439 // refresh requests. 439 // refresh requests.
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 963
964 #undef SDVLOG_LOC 964 #undef SDVLOG_LOC
965 965
966 #undef SDVLOG 966 #undef SDVLOG
967 967
968 #undef SLOG 968 #undef SLOG
969 969
970 #undef ENUM_CASE 970 #undef ENUM_CASE
971 971
972 } // namespace syncer 972 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698