summaryrefslogtreecommitdiffstats
path: root/sync/sessions/sync_session.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 01:41:42 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 01:41:42 +0000
commit0a6e9612034484c5340d6d0f55169c1287c18588 (patch)
treebc4b59868f8609e7c6cfc95e99a4e648d6163d13 /sync/sessions/sync_session.cc
parent7c97bc24bc91ee5ba25296a11e88ad2dd574829c (diff)
downloadchromium_src-0a6e9612034484c5340d6d0f55169c1287c18588.zip
chromium_src-0a6e9612034484c5340d6d0f55169c1287c18588.tar.gz
chromium_src-0a6e9612034484c5340d6d0f55169c1287c18588.tar.bz2
sync: Remove SyncSourceInfo
The SyncSourceInfo was a struct that contained a GetUpdatesSource and a ModelTypeInvalidationMap. Both of these types are in the process of being deprecated. The SyncSourceInfo itself was used only for debugging (about:sync), tests (mostly sync_scheduler_unittest.cc) and maintaining compatibility with some old function signatures. Removing the SyncSourceInfo allow us to remove dependencies on ModelTypeInvalidationMap, which is a step towards enabling invalidation "trickles" support. BUG=233437 Review URL: https://chromiumcodereview.appspot.com/19982002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions/sync_session.cc')
-rw-r--r--sync/sessions/sync_session.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
index eb81733..030ef0f 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();