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

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

Issue 9305001: sync: Remove the remaining conflict sets code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More renames, refactors and fixes Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
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 // StatusController handles all counter and status related number crunching and 5 // StatusController handles all counter and status related number crunching and
6 // state tracking on behalf of a SyncSession. It 'controls' the model data 6 // state tracking on behalf of a SyncSession. It 'controls' the model data
7 // defined in session_state.h. The most important feature of StatusController 7 // defined in session_state.h. The most important feature of StatusController
8 // is the ScopedModelSafetyRestriction. When one of these is active, the 8 // is the ScopedModelSafetyRestriction. When one of these is active, the
9 // underlying data set exposed via accessors is swapped out to the appropriate 9 // underlying data set exposed via accessors is swapped out to the appropriate
10 // set for the restricted ModelSafeGroup behind the scenes. For example, if 10 // set for the restricted ModelSafeGroup behind the scenes. For example, if
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Control parameters for sync cycles. 140 // Control parameters for sync cycles.
141 bool conflicts_resolved() const { 141 bool conflicts_resolved() const {
142 return shared_.control_params.conflicts_resolved; 142 return shared_.control_params.conflicts_resolved;
143 } 143 }
144 bool did_commit_items() const { 144 bool did_commit_items() const {
145 return shared_.control_params.items_committed; 145 return shared_.control_params.items_committed;
146 } 146 }
147 147
148 // If a GetUpdates for any data type resulted in downloading an update that 148 // If a GetUpdates for any data type resulted in downloading an update that
149 // is in conflict, this method returns true. 149 // is in conflict, this method returns true.
150 // Note: this includes non-blocking conflicts. 150 // Note: this includes unresolvable conflicts.
151 bool HasConflictingUpdates() const; 151 bool HasConflictingUpdates() const;
152 152
153 // Aggregate sum of ConflictingItemSize() over all ConflictProgress objects 153 // Aggregate sum of SimpleConflictingItemSize() over all ConflictProgress
154 // (one for each ModelSafeGroup currently in-use). 154 // objects (one for each ModelSafeGroup currently in-use).
155 // Note: this does not include non-blocking conflicts. 155 // Note: this does not include unresolvable conflicts.
156 int TotalNumBlockingConflictingItems() const; 156 int TotalNumSimpleConflictingItems() const;
157 157
158 // Aggregate sum of ConflictingItemSize() and NonblockingConflictingItemsSize 158 // Aggregate sum of SimpleConflictingItemSize() and other
159 // over all ConflictProgress objects (one for each ModelSafeGroup currently 159 // ${Type}ConflictingItemSize() methods over all ConflictProgress objects (one
160 // in-use). 160 // for each ModelSafeGroup currently in-use).
161 int TotalNumConflictingItems() const; 161 int TotalNumConflictingItems() const;
162 162
163 // Returns the number of updates received from the sync server. 163 // Returns the number of updates received from the sync server.
164 int64 CountUpdates() const; 164 int64 CountUpdates() const;
165 165
166 // Returns true iff any of the commit ids added during this session are 166 // Returns true iff any of the commit ids added during this session are
167 // bookmark related, and the bookmark group restriction is in effect. 167 // bookmark related, and the bookmark group restriction is in effect.
168 bool HasBookmarkCommitActivity() const { 168 bool HasBookmarkCommitActivity() const {
169 return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS) && 169 return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS) &&
170 shared_.commit_set.HasBookmarkCommitId(); 170 shared_.commit_set.HasBookmarkCommitId();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 private: 294 private:
295 StatusController* status_; 295 StatusController* status_;
296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); 296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction);
297 }; 297 };
298 298
299 } 299 }
300 } 300 }
301 301
302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ 302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698