Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SYNC_ENGINE_NUDGE_TRACKER_H_ | |
| 6 #define SYNC_ENGINE_NUDGE_TRACKER_H_ | |
|
tim (not reviewing)
2013/04/15 22:37:49
nit - A file (or class) comment would be nice.
| |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "sync/base/sync_export.h" | |
| 11 #include "sync/internal_api/public/sessions/sync_source_info.h" | |
| 12 | |
| 13 namespace syncer { | |
| 14 | |
| 15 namespace sessions { | |
| 16 struct SyncSourceInfo; | |
| 17 } // 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.
| |
| 18 | |
| 19 class SYNC_EXPORT_PRIVATE NudgeTracker { | |
| 20 public: | |
| 21 NudgeTracker(); | |
| 22 ~NudgeTracker(); | |
| 23 | |
| 24 // Merges in the information from another nudge. | |
| 25 void CoalesceSources(const sessions::SyncSourceInfo& source); | |
| 26 | |
| 27 // Returns true if there are no unserviced nudges. | |
| 28 bool IsEmpty(); | |
| 29 | |
| 30 // Clear all unserviced nudges. | |
| 31 void Reset(); | |
| 32 | |
| 33 // Returns the coalesced source info. | |
| 34 const sessions::SyncSourceInfo& source_info() const { | |
| 35 return source_info_; | |
| 36 } | |
| 37 | |
| 38 // Returns the set of locally modified types, according to our tracked source | |
| 39 // infos. The result is often wrong; see implementation comment for details. | |
| 40 ModelTypeSet GetLocallyModifiedTypes() const; | |
| 41 | |
| 42 private: | |
| 43 // Merged source info for the nudge(s). | |
| 44 sessions::SyncSourceInfo source_info_; | |
| 45 }; | |
|
tim (not reviewing)
2013/04/15 22:37:49
DISALLOW_COPY_AND_ASSIGN
rlarocque
2013/04/16 01:30:26
Done.
| |
| 46 | |
| 47 } // namespace syncer | |
| 48 | |
| 49 #endif // SYNC_ENGINE_NUDGE_TRACKER_H_ | |
| OLD | NEW |