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

Side by Side Diff: chrome/browser/sync/sessions/ordered_commit_set.h

Issue 8922015: [Sync] Don't commit items with predecessors/parents in conflict. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ 5 #ifndef CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_
6 #define CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ 6 #define CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 22 matching lines...) Expand all
33 explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes); 33 explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes);
34 ~OrderedCommitSet(); 34 ~OrderedCommitSet();
35 35
36 bool HaveCommitItem(const int64 metahandle) const { 36 bool HaveCommitItem(const int64 metahandle) const {
37 return inserted_metahandles_.count(metahandle) > 0; 37 return inserted_metahandles_.count(metahandle) > 0;
38 } 38 }
39 39
40 void AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, 40 void AddCommitItem(const int64 metahandle, const syncable::Id& commit_id,
41 syncable::ModelType type); 41 syncable::ModelType type);
42 42
43 void Clear();
44
43 const std::vector<syncable::Id>& GetAllCommitIds() const { 45 const std::vector<syncable::Id>& GetAllCommitIds() const {
44 return commit_ids_; 46 return commit_ids_;
45 } 47 }
46 48
47 // Return the Id at index |position| in this OrderedCommitSet. Note that 49 // Return the Id at index |position| in this OrderedCommitSet. Note that
48 // the index uniquely identifies the same logical item in each of: 50 // the index uniquely identifies the same logical item in each of:
49 // 1) this OrderedCommitSet 51 // 1) this OrderedCommitSet
50 // 2) the CommitRequest sent to the server 52 // 2) the CommitRequest sent to the server
51 // 3) the list of EntryResponse objects in the CommitResponse. 53 // 3) the list of EntryResponse objects in the CommitResponse.
52 // These together allow re-association of the pre-commit Id with the 54 // These together allow re-association of the pre-commit Id with the
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 std::vector<syncable::ModelType> types_; 111 std::vector<syncable::ModelType> types_;
110 112
111 browser_sync::ModelSafeRoutingInfo routes_; 113 browser_sync::ModelSafeRoutingInfo routes_;
112 }; 114 };
113 115
114 } // namespace sessions 116 } // namespace sessions
115 } // namespace browser_sync 117 } // namespace browser_sync
116 118
117 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ 119 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_
118 120
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698