| Index: components/sync/engine_impl/syncer.cc
|
| diff --git a/sync/engine/syncer.cc b/components/sync/engine_impl/syncer.cc
|
| similarity index 77%
|
| rename from sync/engine/syncer.cc
|
| rename to components/sync/engine_impl/syncer.cc
|
| index 23d8c961752f77dea95cfe3cc8ab5b29cd17e78a..dda2783e50b9c296e1dda592d64516de81fc93fe 100644
|
| --- a/sync/engine/syncer.cc
|
| +++ b/components/sync/engine_impl/syncer.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "sync/engine/syncer.h"
|
| +#include "components/sync/engine_impl/syncer.h"
|
|
|
| #include <memory>
|
|
|
| @@ -13,22 +13,22 @@
|
| #include "base/time/time.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "build/build_config.h"
|
| -#include "sync/engine/apply_control_data_updates.h"
|
| -#include "sync/engine/clear_server_data.h"
|
| -#include "sync/engine/commit.h"
|
| -#include "sync/engine/commit_processor.h"
|
| -#include "sync/engine/conflict_resolver.h"
|
| -#include "sync/engine/get_updates_delegate.h"
|
| -#include "sync/engine/get_updates_processor.h"
|
| -#include "sync/engine/net/server_connection_manager.h"
|
| -#include "sync/engine/syncer_types.h"
|
| -#include "sync/internal_api/public/base/cancelation_signal.h"
|
| -#include "sync/internal_api/public/base/unique_position.h"
|
| -#include "sync/internal_api/public/util/syncer_error.h"
|
| -#include "sync/sessions/nudge_tracker.h"
|
| -#include "sync/syncable/directory.h"
|
| -#include "sync/syncable/mutable_entry.h"
|
| -#include "sync/syncable/syncable-inl.h"
|
| +#include "components/sync/base/cancelation_signal.h"
|
| +#include "components/sync/base/syncer_error.h"
|
| +#include "components/sync/base/unique_position.h"
|
| +#include "components/sync/engine_impl/apply_control_data_updates.h"
|
| +#include "components/sync/engine_impl/clear_server_data.h"
|
| +#include "components/sync/engine_impl/commit.h"
|
| +#include "components/sync/engine_impl/commit_processor.h"
|
| +#include "components/sync/engine_impl/conflict_resolver.h"
|
| +#include "components/sync/engine_impl/get_updates_delegate.h"
|
| +#include "components/sync/engine_impl/get_updates_processor.h"
|
| +#include "components/sync/engine_impl/net/server_connection_manager.h"
|
| +#include "components/sync/engine_impl/syncer_types.h"
|
| +#include "components/sync/sessions_impl/nudge_tracker.h"
|
| +#include "components/sync/syncable/directory.h"
|
| +#include "components/sync/syncable/mutable_entry.h"
|
| +#include "components/sync/syncable/syncable-inl.h"
|
|
|
| using base::Time;
|
| using base::TimeDelta;
|
| @@ -49,9 +49,7 @@ using sessions::SyncSession;
|
| using sessions::NudgeTracker;
|
|
|
| Syncer::Syncer(syncer::CancelationSignal* cancelation_signal)
|
| - : cancelation_signal_(cancelation_signal),
|
| - is_syncing_(false) {
|
| -}
|
| + : cancelation_signal_(cancelation_signal), is_syncing_(false) {}
|
|
|
| Syncer::~Syncer() {}
|
|
|
| @@ -75,11 +73,9 @@ bool Syncer::NormalSyncShare(ModelTypeSet request_types,
|
| GetUpdatesProcessor get_updates_processor(
|
| session->context()->model_type_registry()->update_handler_map(),
|
| normal_delegate);
|
| - if (!DownloadAndApplyUpdates(
|
| - &request_types,
|
| - session,
|
| - &get_updates_processor,
|
| - kCreateMobileBookmarksFolder)) {
|
| + if (!DownloadAndApplyUpdates(&request_types, session,
|
| + &get_updates_processor,
|
| + kCreateMobileBookmarksFolder)) {
|
| return HandleCycleEnd(session, nudge_tracker->GetLegacySource());
|
| }
|
| }
|
| @@ -105,16 +101,12 @@ bool Syncer::ConfigureSyncShare(
|
| GetUpdatesProcessor get_updates_processor(
|
| session->context()->model_type_registry()->update_handler_map(),
|
| configure_delegate);
|
| - DownloadAndApplyUpdates(
|
| - &request_types,
|
| - session,
|
| - &get_updates_processor,
|
| - kCreateMobileBookmarksFolder);
|
| + DownloadAndApplyUpdates(&request_types, session, &get_updates_processor,
|
| + kCreateMobileBookmarksFolder);
|
| return HandleCycleEnd(session, source);
|
| }
|
|
|
| -bool Syncer::PollSyncShare(ModelTypeSet request_types,
|
| - SyncSession* session) {
|
| +bool Syncer::PollSyncShare(ModelTypeSet request_types, SyncSession* session) {
|
| base::AutoReset<bool> is_syncing(&is_syncing_, true);
|
| VLOG(1) << "Polling types " << ModelTypeSetToString(request_types);
|
| HandleCycleBegin(session);
|
| @@ -122,25 +114,19 @@ bool Syncer::PollSyncShare(ModelTypeSet request_types,
|
| GetUpdatesProcessor get_updates_processor(
|
| session->context()->model_type_registry()->update_handler_map(),
|
| poll_delegate);
|
| - DownloadAndApplyUpdates(
|
| - &request_types,
|
| - session,
|
| - &get_updates_processor,
|
| - kCreateMobileBookmarksFolder);
|
| + DownloadAndApplyUpdates(&request_types, session, &get_updates_processor,
|
| + kCreateMobileBookmarksFolder);
|
| return HandleCycleEnd(session, sync_pb::GetUpdatesCallerInfo::PERIODIC);
|
| }
|
|
|
| -bool Syncer::DownloadAndApplyUpdates(
|
| - ModelTypeSet* request_types,
|
| - SyncSession* session,
|
| - GetUpdatesProcessor* get_updates_processor,
|
| - bool create_mobile_bookmarks_folder) {
|
| +bool Syncer::DownloadAndApplyUpdates(ModelTypeSet* request_types,
|
| + SyncSession* session,
|
| + GetUpdatesProcessor* get_updates_processor,
|
| + bool create_mobile_bookmarks_folder) {
|
| SyncerError download_result = UNSET;
|
| do {
|
| download_result = get_updates_processor->DownloadUpdates(
|
| - request_types,
|
| - session,
|
| - create_mobile_bookmarks_folder);
|
| + request_types, session, create_mobile_bookmarks_folder);
|
| } while (download_result == SERVER_MORE_TO_DOWNLOAD);
|
|
|
| // Exit without applying if we're shutting down or an error was detected.
|
|
|