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

Unified Diff: sync/engine/syncer.h

Issue 17052007: sync: Expose sync functionality as functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finish addressing latest review comments Created 7 years, 6 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 | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer.h
diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h
index 8656e7c2cabf6af93f79601c2725008195558a98..f2e3c73db38b70e1e140dd14c9a10d2a5357379b 100644
--- a/sync/engine/syncer.h
+++ b/sync/engine/syncer.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/synchronization/lock.h"
#include "sync/base/sync_export.h"
@@ -20,21 +21,6 @@
namespace syncer {
-namespace syncable {
-class Entry;
-class MutableEntry;
-} // namespace syncable
-
-enum SyncerStep {
- SYNCER_BEGIN,
- DOWNLOAD_UPDATES,
- PROCESS_UPDATES,
- STORE_TIMESTAMPS,
- APPLY_UPDATES,
- COMMIT,
- SYNCER_END
-};
-
// A Syncer provides a control interface for driving the individual steps
// of the sync cycle. Each cycle (hopefully) moves the client into closer
// synchronization with the server. The individual steps are modeled
@@ -57,14 +43,23 @@ class SYNC_EXPORT_PRIVATE Syncer {
bool ExitRequested();
void RequestEarlyExit();
- // Runs a sync cycle from |first_step| to |last_step|.
- // Returns true if the cycle completed with |last_step|, and false
- // if it terminated early due to error / exit requested.
- virtual bool SyncShare(sessions::SyncSession* session,
- SyncerStep first_step,
- SyncerStep last_step);
+ virtual bool NormalSyncShare(ModelTypeSet request_types,
+ const sessions::NudgeTracker& nudge_tracker,
+ sessions::SyncSession* session);
+ virtual bool ConfigureSyncShare(ModelTypeSet request_types,
+ sessions::SyncSession* session);
+ virtual bool PollSyncShare(ModelTypeSet request_types,
+ sessions::SyncSession* session);
private:
+ void ApplyUpdates(sessions::SyncSession* session);
+ bool DownloadAndApplyUpdates(
+ sessions::SyncSession* session,
+ base::Callback<SyncerError(void)> download_fn);
+
+ void HandleCycleBegin(sessions::SyncSession* session);
+ bool HandleCycleEnd(sessions::SyncSession* session);
+
bool early_exit_requested_;
base::Lock early_exit_requested_lock_;
@@ -93,10 +88,6 @@ class SYNC_EXPORT_PRIVATE Syncer {
DISALLOW_COPY_AND_ASSIGN(Syncer);
};
-// Utility function declarations.
-void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest);
-const char* SyncerStepToString(const SyncerStep);
-
} // namespace syncer
#endif // SYNC_ENGINE_SYNCER_H_
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698