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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.h

Issue 437683002: Wire sync shutdown reason from PSS all the way down to sync manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host_core.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host.h
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index 38459a4130c6c564d16c7a310631dc4e872e0015..32615d45f632b9a0c710c23e9a270254ea73d785 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -16,6 +16,7 @@
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/configure_reason.h"
#include "sync/internal_api/public/sessions/sync_session_snapshot.h"
+#include "sync/internal_api/public/shutdown_reason.h"
#include "sync/internal_api/public/sync_context_proxy.h"
#include "sync/internal_api/public/sync_manager.h"
#include "sync/internal_api/public/sync_manager_factory.h"
@@ -115,18 +116,16 @@ class SyncBackendHost : public sync_driver::BackendDataTypeConfigurer {
// Called on |frontend_loop_| to kick off shutdown.
// See the implementation and Core::DoShutdown for details.
- // Must be called *after* StopSyncingForShutdown. Caller should claim sync
- // thread using STOP_AND_CLAIM_THREAD or DISABLE_AND_CLAIM_THREAD if sync
- // backend might be recreated later because otherwise:
- // * sync loop may be stopped on main loop and cause it to be blocked.
- // * new/old backend may interfere with each other if new backend is created
- // before old one finishes cleanup.
- enum ShutdownOption {
- STOP, // Stop syncing and let backend stop sync thread.
- STOP_AND_CLAIM_THREAD, // Stop syncing and return sync thread.
- DISABLE_AND_CLAIM_THREAD, // Disable sync and return sync thread.
- };
- virtual scoped_ptr<base::Thread> Shutdown(ShutdownOption option) = 0;
+ // Must be called *after* StopSyncingForShutdown.
+ // For any reason other than BROWSER_SHUTDOWN, caller should claim sync
+ // thread because:
+ // * during browser shutdown sync thread is not claimed to avoid blocking
+ // browser shutdown on sync shutdown.
+ // * otherwise sync thread is claimed so that if sync backend is recreated
+ // later, initialization of new backend is serialized on previous sync
+ // thread after cleanup of previous backend to avoid old/new backends
+ // interfere with each other.
+ virtual scoped_ptr<base::Thread> Shutdown(syncer::ShutdownReason reason) = 0;
// Removes all current registrations from the backend on the
// InvalidationService.
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698