Chromium Code Reviews| 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. |