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

Unified Diff: sync/engine/syncer.cc

Issue 23189021: sync: Gracefully handle very early shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client compile Created 7 years, 4 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
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 3d66ca30fa954d094d07579624dd983e51903d1d..2d67c7f4e7a26a52ca0c1b2eb51c3899397e06ed 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -19,6 +19,7 @@
#include "sync/engine/net/server_connection_manager.h"
#include "sync/engine/process_commit_response_command.h"
#include "sync/engine/syncer_types.h"
+#include "sync/internal_api/public/base/cancellation_signal.h"
#include "sync/internal_api/public/base/unique_position.h"
#include "sync/internal_api/public/util/syncer_error.h"
#include "sync/sessions/nudge_tracker.h"
@@ -43,20 +44,14 @@ using sessions::StatusController;
using sessions::SyncSession;
using sessions::NudgeTracker;
-Syncer::Syncer()
- : early_exit_requested_(false) {
+Syncer::Syncer(syncer::CancellationSignal* cancellation_signal)
+ : cancellation_signal_(cancellation_signal) {
}
Syncer::~Syncer() {}
bool Syncer::ExitRequested() {
- base::AutoLock lock(early_exit_requested_lock_);
- return early_exit_requested_;
-}
-
-void Syncer::RequestEarlyExit() {
- base::AutoLock lock(early_exit_requested_lock_);
- early_exit_requested_ = true;
+ return cancellation_signal_->IsStopRequested();
}
bool Syncer::NormalSyncShare(ModelTypeSet request_types,

Powered by Google App Engine
This is Rietveld 408576698