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

Unified Diff: sync/sessions/ordered_commit_set.h

Issue 10210009: sync: Loop committing items without downloading updates (v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor loop again, add comments + more Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: sync/sessions/ordered_commit_set.h
diff --git a/sync/sessions/ordered_commit_set.h b/sync/sessions/ordered_commit_set.h
index 8551c070165f3fc36fdff468663618b4c9a35c37..f8e6938736b32dd3bdb4d5ce84a4f4ba7bd6c883 100644
--- a/sync/sessions/ordered_commit_set.h
+++ b/sync/sessions/ordered_commit_set.h
@@ -64,14 +64,17 @@ class OrderedCommitSet {
// belonging to |group|. This is useful when you need to process a commit
// response one ModelSafeGroup at a time. See GetCommitIdAt for how the
// indices contained in the returned Projection can be used.
- const Projection& GetCommitIdProjection(browser_sync::ModelSafeGroup group) {
- return projections_[group];
- }
+ const Projection& GetCommitIdProjection(
+ browser_sync::ModelSafeGroup group) const;
- int Size() const {
+ size_t Size() const {
return commit_ids_.size();
}
+ bool Empty() const {
+ return Size() == 0;
+ }
+
// Returns true iff any of the commit ids added to this set have model type
// BOOKMARKS.
bool HasBookmarkCommitId() const;
@@ -80,6 +83,9 @@ class OrderedCommitSet {
void AppendReverse(const OrderedCommitSet& other);
void Truncate(size_t max_size);
+ // Removes all entries from this set.
+ void Clear();
+
void operator=(const OrderedCommitSet& other);
private:
// A set of CommitIdProjections associated with particular ModelSafeGroups.
@@ -92,7 +98,7 @@ class OrderedCommitSet {
syncable::ModelType group;
};
- CommitItem GetCommitItemAt(const int position) const;
+ CommitItem GetCommitItemAt(const size_t position) const;
// These lists are different views of the same items; e.g they are
// isomorphic.

Powered by Google App Engine
This is Rietveld 408576698