| Index: sync/sessions/sync_session.cc
|
| diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
|
| index eb81733da633fba0db5e534930f96eedacbcb3c2..030ef0f0f5849b7859ebf5db67a887483f75fdf6 100644
|
| --- a/sync/sessions/sync_session.cc
|
| +++ b/sync/sessions/sync_session.cc
|
| @@ -17,17 +17,14 @@ namespace sessions {
|
|
|
| // static
|
| SyncSession* SyncSession::Build(SyncSessionContext* context,
|
| - Delegate* delegate,
|
| - const SyncSourceInfo& source) {
|
| - return new SyncSession(context, delegate, source);
|
| + Delegate* delegate) {
|
| + return new SyncSession(context, delegate);
|
| }
|
|
|
| SyncSession::SyncSession(
|
| SyncSessionContext* context,
|
| - Delegate* delegate,
|
| - const SyncSourceInfo& source)
|
| + Delegate* delegate)
|
| : context_(context),
|
| - source_(source),
|
| delegate_(delegate) {
|
| status_controller_.reset(new StatusController());
|
| }
|
| @@ -35,6 +32,11 @@ SyncSession::SyncSession(
|
| SyncSession::~SyncSession() {}
|
|
|
| SyncSessionSnapshot SyncSession::TakeSnapshot() const {
|
| + return TakeSnapshotWithSource(sync_pb::GetUpdatesCallerInfo::UNKNOWN);
|
| +}
|
| +
|
| +SyncSessionSnapshot SyncSession::TakeSnapshotWithSource(
|
| + sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) const {
|
| syncable::Directory* dir = context_->directory();
|
|
|
| ProgressMarkerMap download_progress_markers;
|
| @@ -55,16 +57,26 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
|
| status_controller_->num_encryption_conflicts(),
|
| status_controller_->num_hierarchy_conflicts(),
|
| status_controller_->num_server_conflicts(),
|
| - source_,
|
| context_->notifications_enabled(),
|
| dir->GetEntriesCount(),
|
| status_controller_->sync_start_time(),
|
| num_entries_by_type,
|
| - num_to_delete_entries_by_type);
|
| + num_to_delete_entries_by_type,
|
| + legacy_updates_source);
|
|
|
| return snapshot;
|
| }
|
|
|
| +void SyncSession::SendSyncCycleEndEventNotification(
|
| + sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source) {
|
| + SyncEngineEvent event(SyncEngineEvent::SYNC_CYCLE_ENDED);
|
| + event.snapshot = TakeSnapshotWithSource(source);
|
| +
|
| + DVLOG(1) << "Sending cycle end event with snapshot: "
|
| + << event.snapshot.ToString();
|
| + context()->NotifyListeners(event);
|
| +}
|
| +
|
| void SyncSession::SendEventNotification(SyncEngineEvent::EventCause cause) {
|
| SyncEngineEvent event(cause);
|
| event.snapshot = TakeSnapshot();
|
|
|