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

Unified Diff: sync/sessions/ordered_commit_set.h

Issue 10038041: sync: Loop committing items without downloading updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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..fd2194d2361fa31a71546bbd14347a5e55f374a0 100644
--- a/sync/sessions/ordered_commit_set.h
+++ b/sync/sessions/ordered_commit_set.h
@@ -64,14 +64,21 @@ 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 {
+ Projections::const_iterator i = projections_.find(group);
rlarocque 2012/04/13 02:02:22 Because operator[]() is non-const.
+ DCHECK(i != projections_.end());
+ return i->second;
}
- 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;
@@ -92,7 +99,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