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.
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_
12 #include "base/compiler_specific.h"
13 #include "sync/base/sync_export.h"
14 #include "sync/internal_api/public/sessions/sync_source_info.h"
19 struct SyncSourceInfo
;
21 class SYNC_EXPORT_PRIVATE NudgeTracker
{
26 // Merges in the information from another nudge.
27 void CoalesceSources(const SyncSourceInfo
& source
);
29 // Returns true if there are no unserviced nudges.
32 // Clear all unserviced nudges.
35 // Returns the coalesced source info.
36 const SyncSourceInfo
& source_info() const {
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;
45 // Merged source info for the nudge(s).
46 SyncSourceInfo source_info_
;
48 DISALLOW_COPY_AND_ASSIGN(NudgeTracker
);
51 } // namespace sessions
54 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_