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

Side by Side Diff: sync/engine/update_applicator.h

Issue 11192071: sync: Merge apply updates and resolve conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry (base files were missing) Created 8 years, 1 month 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
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/engine/update_applicator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // An UpdateApplicator is used to iterate over a number of unapplied updates, 5 // An UpdateApplicator is used to iterate over a number of unapplied updates,
6 // applying them to the client using the given syncer session. 6 // applying them to the client using the given syncer session.
7 // 7 //
8 // UpdateApplicator might resemble an iterator, but it actually keeps retrying 8 // UpdateApplicator might resemble an iterator, but it actually keeps retrying
9 // failed updates until no remaining updates can be successfully applied. 9 // failed updates until no remaining updates can be successfully applied.
10 10
(...skipping 17 matching lines...) Expand all
28 namespace syncable { 28 namespace syncable {
29 class WriteTransaction; 29 class WriteTransaction;
30 class Entry; 30 class Entry;
31 } 31 }
32 32
33 class ConflictResolver; 33 class ConflictResolver;
34 class Cryptographer; 34 class Cryptographer;
35 35
36 class UpdateApplicator { 36 class UpdateApplicator {
37 public: 37 public:
38 typedef std::vector<int64>::iterator UpdateIterator;
39
40 UpdateApplicator(Cryptographer* cryptographer, 38 UpdateApplicator(Cryptographer* cryptographer,
41 const ModelSafeRoutingInfo& routes, 39 const ModelSafeRoutingInfo& routes,
42 ModelSafeGroup group_filter); 40 ModelSafeGroup group_filter);
43 ~UpdateApplicator(); 41 ~UpdateApplicator();
44 42
45 // Attempt to apply the specified updates. 43 // Attempt to apply the specified updates.
46 void AttemptApplications(syncable::WriteTransaction* trans, 44 void AttemptApplications(syncable::WriteTransaction* trans,
47 const std::vector<int64>& handles, 45 const std::vector<int64>& handles);
48 sessions::StatusController* status); 46
47 int updates_applied() {
48 return updates_applied_;
49 }
50
51 int encryption_conflicts() {
52 return encryption_conflicts_;
53 }
54
55 int hierarchy_conflicts() {
56 return hierarchy_conflicts_;
57 }
58
59 const std::set<syncable::Id>& simple_conflict_ids() {
60 return simple_conflict_ids_;
61 }
49 62
50 private: 63 private:
51 // If true, AttemptOneApplication will skip over |entry| and return true. 64 // If true, AttemptOneApplication will skip over |entry| and return true.
52 bool SkipUpdate(const syncable::Entry& entry); 65 bool SkipUpdate(const syncable::Entry& entry);
53 66
54 // Used to decrypt sensitive sync nodes. 67 // Used to decrypt sensitive sync nodes.
55 Cryptographer* cryptographer_; 68 Cryptographer* cryptographer_;
56 69
57 ModelSafeGroup group_filter_; 70 ModelSafeGroup group_filter_;
58 71
59 const ModelSafeRoutingInfo routing_info_; 72 const ModelSafeRoutingInfo routing_info_;
60 73
61 DISALLOW_COPY_AND_ASSIGN(UpdateApplicator); 74 DISALLOW_COPY_AND_ASSIGN(UpdateApplicator);
75
76 int updates_applied_;
77 int encryption_conflicts_;
78 int hierarchy_conflicts_;
79 std::set<syncable::Id> simple_conflict_ids_;
62 }; 80 };
63 81
64 } // namespace syncer 82 } // namespace syncer
65 83
66 #endif // SYNC_ENGINE_UPDATE_APPLICATOR_H_ 84 #endif // SYNC_ENGINE_UPDATE_APPLICATOR_H_
OLDNEW
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/engine/update_applicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698