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

Unified Diff: sync/sessions/nudge_tracker.h

Issue 13743003: sync: Finish the SyncScheduler refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix AuthErrorTest Created 7 years, 8 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/syncer_unittest.cc ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/nudge_tracker.h
diff --git a/sync/sessions/nudge_tracker.h b/sync/sessions/nudge_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..0128ce096efa4075383b579b502f44eafcd75297
--- /dev/null
+++ b/sync/sessions/nudge_tracker.h
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// A class to track the outstanding work required to bring the client back into
+// sync with the server.
+#ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_
+#define SYNC_SESSIONS_NUDGE_TRACKER_H_
+
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/sessions/sync_source_info.h"
+
+namespace syncer {
+namespace sessions {
+
+struct SyncSourceInfo;
+
+class SYNC_EXPORT_PRIVATE NudgeTracker {
+ public:
+ NudgeTracker();
+ ~NudgeTracker();
+
+ // Merges in the information from another nudge.
+ void CoalesceSources(const SyncSourceInfo& source);
+
+ // Returns true if there are no unserviced nudges.
+ bool IsEmpty();
+
+ // Clear all unserviced nudges.
+ void Reset();
+
+ // Returns the coalesced source info.
+ const SyncSourceInfo& source_info() const {
+ return source_info_;
+ }
+
+ // Returns the set of locally modified types, according to our tracked source
+ // infos. The result is often wrong; see implementation comment for details.
+ ModelTypeSet GetLocallyModifiedTypes() const;
+
+ private:
+ // Merged source info for the nudge(s).
+ SyncSourceInfo source_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(NudgeTracker);
+};
+
+} // namespace sessions
+} // namespace syncer
+
+#endif // SYNC_SESSIONS_NUDGE_TRACKER_H_
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698