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

Unified Diff: chrome/browser/sync/engine/syncer_thread2.h

Issue 6286067: sync: add a SyncSessionJobPurpose for clearing sync user data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: whitespace Created 9 years, 11 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: chrome/browser/sync/engine/syncer_thread2.h
diff --git a/chrome/browser/sync/engine/syncer_thread2.h b/chrome/browser/sync/engine/syncer_thread2.h
index afa1814001ffc1d85a228cf43a154cdab181a7cd..a9848ff4cfabefb410f6974a933b37a59c74284e 100644
--- a/chrome/browser/sync/engine/syncer_thread2.h
+++ b/chrome/browser/sync/engine/syncer_thread2.h
@@ -16,13 +16,13 @@
#include "base/timer.h"
#include "chrome/browser/sync/engine/nudge_source.h"
#include "chrome/browser/sync/engine/polling_constants.h"
+#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/sessions/sync_session.h"
#include "chrome/browser/sync/sessions/sync_session_context.h"
namespace browser_sync {
struct ServerConnectionEvent;
-class Syncer;
namespace s3 {
@@ -65,6 +65,7 @@ class SyncerThread : public sessions::SyncSession::Delegate {
const sessions::TypePayloadMap& types_with_payloads);
void ScheduleConfig(const base::TimeDelta& delay,
const syncable::ModelTypeBitSet& types);
+ void ScheduleClearUserData();
// Change status of notifications in the SyncSessionContext.
void set_notifications_enabled(bool notifications_enabled);
@@ -97,6 +98,9 @@ class SyncerThread : public sessions::SyncSession::Delegate {
// A nudge task can come from a variety of components needing to force
// a sync. The source is inferable from |session.source()|.
NUDGE,
+ // The user invoked a function in the UI to clear their entire account
+ // and stop syncing (globally).
+ CLEAR_USER_DATA,
// Typically used for fetching updates for a subset of the enabled types
// during initial sync or reconfiguration. We don't run all steps of
// the sync cycle for these (e.g. CleanupDisabledTypes is skipped).
@@ -153,6 +157,7 @@ class SyncerThread : public sessions::SyncSession::Delegate {
void ScheduleConfigImpl(const base::TimeDelta& delay,
const ModelSafeRoutingInfo& routing_info,
const std::vector<ModelSafeWorker*>& workers);
+ void ScheduleClearUserDataImpl();
// Returns true if the client is currently in exponential backoff.
bool IsBackingOff() const;
@@ -171,6 +176,12 @@ class SyncerThread : public sessions::SyncSession::Delegate {
// Creates a session for a poll and performs the sync.
void PollTimerCallback();
+ // Assign |start| and |end| to appropriate SyncerStep values for the
+ // specified |purpose|.
+ void SetSyncerStepsForPurpose(SyncSessionJobPurpose purpose,
+ SyncerStep* start,
+ SyncerStep* end);
+
base::Thread thread_;
// Modifiable versions of kDefaultLongPollIntervalSeconds which can be

Powered by Google App Engine
This is Rietveld 408576698