| Index: components/sync/sessions_impl/sync_session.cc
|
| diff --git a/sync/sessions/sync_session.cc b/components/sync/sessions_impl/sync_session.cc
|
| similarity index 69%
|
| rename from sync/sessions/sync_session.cc
|
| rename to components/sync/sessions_impl/sync_session.cc
|
| index 70c1a8237ddfb348be226707ebd1bb5f05bf0608..bb6e492df98de50f89de994bba4ca29e2f5f3fd1 100644
|
| --- a/sync/sessions/sync_session.cc
|
| +++ b/components/sync/sessions_impl/sync_session.cc
|
| @@ -2,15 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "sync/sessions/sync_session.h"
|
| +#include "components/sync/sessions_impl/sync_session.h"
|
|
|
| #include <algorithm>
|
| #include <iterator>
|
|
|
| #include "base/logging.h"
|
| -#include "sync/internal_api/public/base/model_type.h"
|
| -#include "sync/internal_api/public/engine/model_safe_worker.h"
|
| -#include "sync/syncable/directory.h"
|
| +#include "components/sync/base/model_type.h"
|
| +#include "components/sync/engine/model_safe_worker.h"
|
| +#include "components/sync/syncable/directory.h"
|
|
|
| namespace syncer {
|
| namespace sessions {
|
| @@ -21,11 +21,8 @@ SyncSession* SyncSession::Build(SyncSessionContext* context,
|
| return new SyncSession(context, delegate);
|
| }
|
|
|
| -SyncSession::SyncSession(
|
| - SyncSessionContext* context,
|
| - Delegate* delegate)
|
| - : context_(context),
|
| - delegate_(delegate) {
|
| +SyncSession::SyncSession(SyncSessionContext* context, Delegate* delegate)
|
| + : context_(context), delegate_(delegate) {
|
| status_controller_.reset(new StatusController());
|
| }
|
|
|
| @@ -36,7 +33,8 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
|
| }
|
|
|
| SyncSessionSnapshot SyncSession::TakeSnapshotWithSource(
|
| - sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) const {
|
| + sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source)
|
| + const {
|
| syncable::Directory* dir = context_->directory();
|
|
|
| ProgressMarkerMap download_progress_markers;
|
| @@ -51,19 +49,15 @@ SyncSessionSnapshot SyncSession::TakeSnapshotWithSource(
|
| &num_to_delete_entries_by_type);
|
|
|
| SyncSessionSnapshot snapshot(
|
| - status_controller_->model_neutral_state(),
|
| - download_progress_markers,
|
| + status_controller_->model_neutral_state(), download_progress_markers,
|
| delegate_->IsCurrentlyThrottled(),
|
| status_controller_->num_encryption_conflicts(),
|
| status_controller_->num_hierarchy_conflicts(),
|
| status_controller_->num_server_conflicts(),
|
| - context_->notifications_enabled(),
|
| - dir->GetEntriesCount(),
|
| + context_->notifications_enabled(), dir->GetEntriesCount(),
|
| status_controller_->sync_start_time(),
|
| - status_controller_->poll_finish_time(),
|
| - num_entries_by_type,
|
| - num_to_delete_entries_by_type,
|
| - legacy_updates_source);
|
| + status_controller_->poll_finish_time(), num_entries_by_type,
|
| + num_to_delete_entries_by_type, legacy_updates_source);
|
|
|
| return snapshot;
|
| }
|
| @@ -74,9 +68,8 @@ void SyncSession::SendSyncCycleEndEventNotification(
|
| event.snapshot = TakeSnapshotWithSource(source);
|
|
|
| DVLOG(1) << "Sending cycle end event with snapshot: "
|
| - << event.snapshot.ToString();
|
| - FOR_EACH_OBSERVER(SyncEngineEventListener,
|
| - *(context_->listeners()),
|
| + << event.snapshot.ToString();
|
| + FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()),
|
| OnSyncCycleEvent(event));
|
| }
|
|
|
| @@ -85,14 +78,12 @@ void SyncSession::SendEventNotification(SyncCycleEvent::EventCause cause) {
|
| event.snapshot = TakeSnapshot();
|
|
|
| DVLOG(1) << "Sending event with snapshot: " << event.snapshot.ToString();
|
| - FOR_EACH_OBSERVER(SyncEngineEventListener,
|
| - *(context_->listeners()),
|
| + FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()),
|
| OnSyncCycleEvent(event));
|
| }
|
|
|
| void SyncSession::SendProtocolEvent(const ProtocolEvent& event) {
|
| - FOR_EACH_OBSERVER(SyncEngineEventListener,
|
| - *(context_->listeners()),
|
| + FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()),
|
| OnProtocolEvent(event));
|
| }
|
|
|
|
|