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

Side by Side Diff: sync/sessions/nudge_tracker.h

Issue 19309002: sync: Add pre-commit update avoidance mode + flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A class to track the outstanding work required to bring the client back into 5 // A class to track the outstanding work required to bring the client back into
6 // sync with the server. 6 // sync with the server.
7 #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_ 7 #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_
8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ 8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_
9 9
10 #include <list> 10 #include <list>
(...skipping 16 matching lines...) Expand all
27 static size_t kDefaultMaxPayloadsPerType; 27 static size_t kDefaultMaxPayloadsPerType;
28 28
29 NudgeTracker(); 29 NudgeTracker();
30 ~NudgeTracker(); 30 ~NudgeTracker();
31 31
32 // Returns true if there is a good reason for performing a sync cycle. 32 // Returns true if there is a good reason for performing a sync cycle.
33 // This does not take into account whether or not this is a good *time* to 33 // This does not take into account whether or not this is a good *time* to
34 // perform a sync cycle; that's the scheduler's job. 34 // perform a sync cycle; that's the scheduler's job.
35 bool IsSyncRequired() const; 35 bool IsSyncRequired() const;
36 36
37 // Returns true if there is a good reason for performan a get updates
Nicolas Zea 2013/07/16 00:24:32 performan -> performing
rlarocque 2013/07/16 01:08:27 Done.
38 // request as part of the next sync cycle.
39 bool IsGetUpdatesRequired() const;
40
37 // Tells this class that all required update fetching and committing has 41 // Tells this class that all required update fetching and committing has
38 // completed successfully. 42 // completed successfully.
39 void RecordSuccessfulSyncCycle(); 43 void RecordSuccessfulSyncCycle();
40 44
41 // Takes note of a local change. 45 // Takes note of a local change.
42 void RecordLocalChange(ModelTypeSet types); 46 void RecordLocalChange(ModelTypeSet types);
43 47
44 // Takes note of a locally issued request to refresh a data type. 48 // Takes note of a locally issued request to refresh a data type.
45 void RecordLocalRefreshRequest(ModelTypeSet types); 49 void RecordLocalRefreshRequest(ModelTypeSet types);
46 50
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 134
131 size_t num_payloads_per_type_; 135 size_t num_payloads_per_type_;
132 136
133 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); 137 DISALLOW_COPY_AND_ASSIGN(NudgeTracker);
134 }; 138 };
135 139
136 } // namespace sessions 140 } // namespace sessions
137 } // namespace syncer 141 } // namespace syncer
138 142
139 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ 143 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698