Index: sync/engine/nudge_tracker.h |
diff --git a/sync/engine/nudge_tracker.h b/sync/engine/nudge_tracker.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ab962257ebc190dbd1a5a90c8beacac7f6ee362 |
--- /dev/null |
+++ b/sync/engine/nudge_tracker.h |
@@ -0,0 +1,49 @@ |
+// 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. |
+ |
+#ifndef SYNC_ENGINE_NUDGE_TRACKER_H_ |
+#define SYNC_ENGINE_NUDGE_TRACKER_H_ |
tim (not reviewing)
2013/04/15 22:37:49
nit - A file (or class) comment would be nice.
|
+ |
+#include <vector> |
+ |
+#include "sync/base/sync_export.h" |
+#include "sync/internal_api/public/sessions/sync_source_info.h" |
+ |
+namespace syncer { |
+ |
+namespace sessions { |
+struct SyncSourceInfo; |
+} // namespace sessions |
tim (not reviewing)
2013/04/15 22:37:49
nit - the comment isn't necessary when the whole n
rlarocque
2013/04/16 01:30:26
Maybe? I never understood why sessions had to be
tim (not reviewing)
2013/04/16 20:16:24
I think so. Sessions can interact with whatever it
rlarocque
2013/04/16 22:20:05
Done.
|
+ |
+class SYNC_EXPORT_PRIVATE NudgeTracker { |
+ public: |
+ NudgeTracker(); |
+ ~NudgeTracker(); |
+ |
+ // Merges in the information from another nudge. |
+ void CoalesceSources(const sessions::SyncSourceInfo& source); |
+ |
+ // Returns true if there are no unserviced nudges. |
+ bool IsEmpty(); |
+ |
+ // Clear all unserviced nudges. |
+ void Reset(); |
+ |
+ // Returns the coalesced source info. |
+ const sessions::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). |
+ sessions::SyncSourceInfo source_info_; |
+}; |
tim (not reviewing)
2013/04/15 22:37:49
DISALLOW_COPY_AND_ASSIGN
rlarocque
2013/04/16 01:30:26
Done.
|
+ |
+} // namespace syncer |
+ |
+#endif // SYNC_ENGINE_NUDGE_TRACKER_H_ |