Index: chrome/browser/sync/engine/syncer.cc |
diff --git a/chrome/browser/sync/engine/syncer.cc b/chrome/browser/sync/engine/syncer.cc |
index fae03fa1787d343373a5537f1a776b1352075129..ac3930c93506a4cfc0e627543416847183a6be92 100644 |
--- a/chrome/browser/sync/engine/syncer.cc |
+++ b/chrome/browser/sync/engine/syncer.cc |
@@ -54,6 +54,15 @@ using sessions::StatusController; |
using sessions::SyncSession; |
using sessions::ConflictProgress; |
+Syncer::ScopedSyncStartStopTracker::ScopedSyncStartStopTracker( |
+ sessions::SyncSession* session) : session_(session) { |
+ session_->status_controller()->SetSyncInProgressAndUpdateStartTime(true); |
+} |
+ |
+Syncer::ScopedSyncStartStopTracker::~ScopedSyncStartStopTracker() { |
+ session_->status_controller()->SetSyncInProgressAndUpdateStartTime(false); |
+} |
+ |
Syncer::Syncer() |
: early_exit_requested_(false), |
pre_conflict_resolution_closure_(NULL) { |
@@ -83,6 +92,8 @@ void Syncer::SyncShare(sessions::SyncSession* session, |
ScopedSessionContextConflictResolver scoped(session->context(), |
&resolver_); |
+ |
+ ScopedSyncStartStopTracker start_stop_tracker(session); |
SyncerStep current_step = first_step; |
SyncerStep next_step = current_step; |
@@ -112,6 +123,10 @@ void Syncer::SyncShare(sessions::SyncSession* session, |
} |
case DOWNLOAD_UPDATES: { |
VLOG(1) << "Downloading Updates"; |
+ |
+ // We would call set_syncing(false) at the SYNCER_END step. Note if |
+ // we are on DOWNLOAD_UPDATES state we would not exit without |
+ // going to SYNCER_END because of various cleanup steps. |
tim (not reviewing)
2011/08/10 00:08:29
remove comment
|
DownloadUpdatesCommand download_updates; |
download_updates.Execute(session); |
next_step = PROCESS_CLIENT_COMMAND; |
@@ -168,8 +183,6 @@ void Syncer::SyncShare(sessions::SyncSession* session, |
// These two steps are combined since they are executed within the same |
// write transaction. |
case BUILD_COMMIT_REQUEST: { |
- session->status_controller()->set_syncing(true); |
- |
VLOG(1) << "Processing Commit Request"; |
ScopedDirLookup dir(session->context()->directory_manager(), |
session->context()->account_name()); |