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

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

Issue 72403003: sync: Per-type update application (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix typo Created 7 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
« 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 UpdateApplicator(Cryptographer* cryptographer, 38 UpdateApplicator(Cryptographer* cryptographer);
39 const ModelSafeRoutingInfo& routes,
40 ModelSafeGroup group_filter);
41 ~UpdateApplicator(); 39 ~UpdateApplicator();
42 40
43 // Attempt to apply the specified updates. 41 // Attempt to apply the specified updates.
44 void AttemptApplications(syncable::WriteTransaction* trans, 42 void AttemptApplications(syncable::WriteTransaction* trans,
45 const std::vector<int64>& handles); 43 const std::vector<int64>& handles);
46 44
47 int updates_applied() { 45 int updates_applied() {
48 return updates_applied_; 46 return updates_applied_;
49 } 47 }
50 48
51 int encryption_conflicts() { 49 int encryption_conflicts() {
52 return encryption_conflicts_; 50 return encryption_conflicts_;
53 } 51 }
54 52
55 int hierarchy_conflicts() { 53 int hierarchy_conflicts() {
56 return hierarchy_conflicts_; 54 return hierarchy_conflicts_;
57 } 55 }
58 56
59 const std::set<syncable::Id>& simple_conflict_ids() { 57 const std::set<syncable::Id>& simple_conflict_ids() {
60 return simple_conflict_ids_; 58 return simple_conflict_ids_;
61 } 59 }
62 60
63 private: 61 private:
64 // If true, AttemptOneApplication will skip over |entry| and return true. 62 // If true, AttemptOneApplication will skip over |entry| and return true.
65 bool SkipUpdate(const syncable::Entry& entry); 63 bool SkipUpdate(const syncable::Entry& entry);
66 64
67 // Used to decrypt sensitive sync nodes. 65 // Used to decrypt sensitive sync nodes.
68 Cryptographer* cryptographer_; 66 Cryptographer* cryptographer_;
69 67
70 ModelSafeGroup group_filter_;
71
72 const ModelSafeRoutingInfo routing_info_;
73
74 DISALLOW_COPY_AND_ASSIGN(UpdateApplicator); 68 DISALLOW_COPY_AND_ASSIGN(UpdateApplicator);
75 69
76 int updates_applied_; 70 int updates_applied_;
77 int encryption_conflicts_; 71 int encryption_conflicts_;
78 int hierarchy_conflicts_; 72 int hierarchy_conflicts_;
79 std::set<syncable::Id> simple_conflict_ids_; 73 std::set<syncable::Id> simple_conflict_ids_;
80 }; 74 };
81 75
82 } // namespace syncer 76 } // namespace syncer
83 77
84 #endif // SYNC_ENGINE_UPDATE_APPLICATOR_H_ 78 #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