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

Unified Diff: trunk/src/sync/internal_api/public/sync_manager.h

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
Index: trunk/src/sync/internal_api/public/sync_manager.h
===================================================================
--- trunk/src/sync/internal_api/public/sync_manager.h (revision 222204)
+++ trunk/src/sync/internal_api/public/sync_manager.h (working copy)
@@ -45,7 +45,6 @@
class SyncEncryptionHandler;
class SyncScheduler;
struct UserShare;
-class CancelationSignal;
namespace sessions {
class SyncSessionSnapshot;
@@ -321,8 +320,7 @@
Encryptor* encryptor,
scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler,
ReportUnrecoverableErrorFunction report_unrecoverable_error_function,
- bool use_oauth2_token,
- CancelationSignal* cancelation_signal) = 0;
+ bool use_oauth2_token) = 0;
// Throw an unrecoverable error from a transaction (mostly used for
// testing).
@@ -394,6 +392,17 @@
// to the syncapi model.
virtual void SaveChanges() = 0;
+ // Initiates shutdown of various components in the sync engine. Must be
+ // called from the main thread to allow preempting ongoing tasks on the sync
+ // loop (that may be blocked on I/O). The semantics of |callback| are the
+ // same as with StartConfigurationMode. If provided and a scheduler / sync
+ // loop exists, it will be invoked from the sync loop by the scheduler to
+ // notify that all work has been flushed + cancelled, and it is idle.
+ // If no scheduler exists, the callback is run immediately (from the loop
+ // this was created on, which is the sync loop), as sync is effectively
+ // stopped.
+ virtual void StopSyncingForShutdown() = 0;
+
// Issue a final SaveChanges, and close sqlite handles.
virtual void ShutdownOnSyncThread() = 0;

Powered by Google App Engine
This is Rietveld 408576698