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

Side by Side Diff: chrome/browser/sync/engine/syncer.h

Issue 7281017: [Sync] Add RequestCleanupDisabledTypes() method to SyncManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix migration integration tests Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_
6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // the SyncerStep enum. 67 // the SyncerStep enum.
68 // 68 //
69 // A Syncer instance expects to run on a dedicated thread. Calls 69 // A Syncer instance expects to run on a dedicated thread. Calls
70 // to SyncShare() may take an unbounded amount of time, as SyncerCommands 70 // to SyncShare() may take an unbounded amount of time, as SyncerCommands
71 // may block on network i/o, on lock contention, or on tasks posted to 71 // may block on network i/o, on lock contention, or on tasks posted to
72 // other threads. 72 // other threads.
73 class Syncer { 73 class Syncer {
74 public: 74 public:
75 typedef std::vector<int64> UnsyncedMetaHandles; 75 typedef std::vector<int64> UnsyncedMetaHandles;
76 76
77 // The constructor may be called from a thread that is not the Syncer's
78 // dedicated thread, to allow some flexibility in the setup.
79 Syncer(); 77 Syncer();
80 virtual ~Syncer(); 78 virtual ~Syncer();
81 79
82 // Called by other threads to tell the syncer to stop what it's doing 80 // Called by other threads to tell the syncer to stop what it's doing
83 // and return early from SyncShare, if possible. 81 // and return early from SyncShare, if possible.
84 bool ExitRequested(); 82 bool ExitRequested();
85 void RequestEarlyExit(); 83 void RequestEarlyExit();
86 84
87 // Like SyncShare() above, but |first_step| and |last_step| are provided to 85 virtual void CleanupDisabledTypes(sessions::SyncSession* session);
88 // perform a partial sync cycle, stopping after |last_step| is performed. 86
87 // Runs a sync cycle from |first_step| to |last_step|.
89 virtual void SyncShare(sessions::SyncSession* session, 88 virtual void SyncShare(sessions::SyncSession* session,
90 SyncerStep first_step, 89 SyncerStep first_step,
91 SyncerStep last_step); 90 SyncerStep last_step);
92 91
93 private: 92 private:
94 // Implements the PROCESS_CLIENT_COMMAND syncer step. 93 // Implements the PROCESS_CLIENT_COMMAND syncer step.
95 void ProcessClientCommand(sessions::SyncSession* session); 94 void ProcessClientCommand(sessions::SyncSession* session);
96 95
97 bool early_exit_requested_; 96 bool early_exit_requested_;
98 base::Lock early_exit_requested_lock_; 97 base::Lock early_exit_requested_lock_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 }; 130 };
132 131
133 // Utility function declarations. 132 // Utility function declarations.
134 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); 133 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest);
135 void ClearServerData(syncable::MutableEntry* entry); 134 void ClearServerData(syncable::MutableEntry* entry);
136 135
137 } // namespace browser_sync 136 } // namespace browser_sync
138 137
139 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ 138 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_
140 139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698