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

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

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: 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
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl.h ('k') | components/sync/engine_impl/syncer.h » ('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 "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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 DCHECK(!types.Empty()); 404 DCHECK(!types.Empty());
405 405
406 SDVLOG_LOC(nudge_location, 2) 406 SDVLOG_LOC(nudge_location, 2)
407 << "Scheduling sync because of local refresh request for " 407 << "Scheduling sync because of local refresh request for "
408 << ModelTypeSetToString(types); 408 << ModelTypeSetToString(types);
409 base::TimeDelta nudge_delay = nudge_tracker_.RecordLocalRefreshRequest(types); 409 base::TimeDelta nudge_delay = nudge_tracker_.RecordLocalRefreshRequest(types);
410 ScheduleNudgeImpl(nudge_delay, nudge_location); 410 ScheduleNudgeImpl(nudge_delay, nudge_location);
411 } 411 }
412 412
413 void SyncSchedulerImpl::ScheduleInvalidationNudge( 413 void SyncSchedulerImpl::ScheduleInvalidationNudge(
414 ModelType model_type, 414 syncer::ModelType model_type,
415 std::unique_ptr<InvalidationInterface> invalidation, 415 std::unique_ptr<InvalidationInterface> invalidation,
416 const tracked_objects::Location& nudge_location) { 416 const tracked_objects::Location& nudge_location) {
417 DCHECK(CalledOnValidThread()); 417 DCHECK(CalledOnValidThread());
418 418
419 SDVLOG_LOC(nudge_location, 2) 419 SDVLOG_LOC(nudge_location, 2)
420 << "Scheduling sync because we received invalidation for " 420 << "Scheduling sync because we received invalidation for "
421 << ModelTypeToString(model_type); 421 << ModelTypeToString(model_type);
422 base::TimeDelta nudge_delay = nudge_tracker_.RecordRemoteInvalidation( 422 base::TimeDelta nudge_delay = nudge_tracker_.RecordRemoteInvalidation(
423 model_type, std::move(invalidation)); 423 model_type, std::move(invalidation));
424 ScheduleNudgeImpl(nudge_delay, nudge_location); 424 ScheduleNudgeImpl(nudge_delay, nudge_location);
425 } 425 }
426 426
427 void SyncSchedulerImpl::ScheduleInitialSyncNudge(ModelType model_type) { 427 void SyncSchedulerImpl::ScheduleInitialSyncNudge(syncer::ModelType model_type) {
428 DCHECK(CalledOnValidThread()); 428 DCHECK(CalledOnValidThread());
429 429
430 SDVLOG(2) << "Scheduling non-blocking initial sync for " 430 SDVLOG(2) << "Scheduling non-blocking initial sync for "
431 << ModelTypeToString(model_type); 431 << ModelTypeToString(model_type);
432 nudge_tracker_.RecordInitialSyncRequired(model_type); 432 nudge_tracker_.RecordInitialSyncRequired(model_type);
433 ScheduleNudgeImpl(TimeDelta::FromSeconds(0), FROM_HERE); 433 ScheduleNudgeImpl(TimeDelta::FromSeconds(0), FROM_HERE);
434 } 434 }
435 435
436 // TODO(zea): Consider adding separate throttling/backoff for datatype 436 // TODO(zea): Consider adding separate throttling/backoff for datatype
437 // refresh requests. 437 // refresh requests.
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 961
962 #undef SDVLOG_LOC 962 #undef SDVLOG_LOC
963 963
964 #undef SDVLOG 964 #undef SDVLOG
965 965
966 #undef SLOG 966 #undef SLOG
967 967
968 #undef ENUM_CASE 968 #undef ENUM_CASE
969 969
970 } // namespace syncer 970 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl.h ('k') | components/sync/engine_impl/syncer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698