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 // A class to track the outstanding work required to bring the client back into |
| 6 // sync with the server. |
| 7 #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_ |
| 8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ |
| 9 |
| 10 #include <vector> |
| 11 |
| 12 #include "base/compiler_specific.h" |
| 13 #include "sync/base/sync_export.h" |
| 14 #include "sync/internal_api/public/sessions/sync_source_info.h" |
| 15 |
| 16 namespace syncer { |
| 17 namespace sessions { |
| 18 |
| 19 struct SyncSourceInfo; |
| 20 |
| 21 class SYNC_EXPORT_PRIVATE NudgeTracker { |
| 22 public: |
| 23 NudgeTracker(); |
| 24 ~NudgeTracker(); |
| 25 |
| 26 // Merges in the information from another nudge. |
| 27 void CoalesceSources(const SyncSourceInfo& source); |
| 28 |
| 29 // Returns true if there are no unserviced nudges. |
| 30 bool IsEmpty(); |
| 31 |
| 32 // Clear all unserviced nudges. |
| 33 void Reset(); |
| 34 |
| 35 // Returns the coalesced source info. |
| 36 const SyncSourceInfo& source_info() const { |
| 37 return source_info_; |
| 38 } |
| 39 |
| 40 // Returns the set of locally modified types, according to our tracked source |
| 41 // infos. The result is often wrong; see implementation comment for details. |
| 42 ModelTypeSet GetLocallyModifiedTypes() const; |
| 43 |
| 44 private: |
| 45 // Merged source info for the nudge(s). |
| 46 SyncSourceInfo source_info_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); |
| 49 }; |
| 50 |
| 51 } // namespace sessions |
| 52 } // namespace syncer |
| 53 |
| 54 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ |
OLD | NEW |