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

Unified Diff: sync/sessions/sync_session.cc

Issue 19982002: sync: Remove SyncSourceInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert SyncShareRecords to typedef Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698