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

Unified Diff: trunk/src/sync/engine/syncer.cc

Issue 23658030: Revert 222154 "sync: Gracefully handle very early shutdown" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | « trunk/src/sync/engine/syncer.h ('k') | trunk/src/sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/sync/engine/syncer.cc
===================================================================
--- trunk/src/sync/engine/syncer.cc (revision 222204)
+++ trunk/src/sync/engine/syncer.cc (working copy)
@@ -19,7 +19,6 @@
#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/cancelation_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"
@@ -44,16 +43,22 @@
using sessions::SyncSession;
using sessions::NudgeTracker;
-Syncer::Syncer(syncer::CancelationSignal* cancelation_signal)
- : cancelation_signal_(cancelation_signal) {
+Syncer::Syncer()
+ : early_exit_requested_(false) {
}
Syncer::~Syncer() {}
bool Syncer::ExitRequested() {
- return cancelation_signal_->IsStopRequested();
+ 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;
+}
+
bool Syncer::NormalSyncShare(ModelTypeSet request_types,
const NudgeTracker& nudge_tracker,
SyncSession* session) {
« no previous file with comments | « trunk/src/sync/engine/syncer.h ('k') | trunk/src/sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698