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

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

Issue 9950137: [not for review] sync: Don't use group_restriction from ApplyUpdatesCommand. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « sync/sessions/session_state.cc ('k') | sync/sessions/status_controller.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 // 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // since it was created or was last reset. 54 // since it was created or was last reset.
55 bool TestAndClearIsDirty(); 55 bool TestAndClearIsDirty();
56 56
57 // Progress counters. All const methods may return NULL if the 57 // Progress counters. All const methods may return NULL if the
58 // progress structure doesn't exist, but all non-const methods 58 // progress structure doesn't exist, but all non-const methods
59 // auto-create. 59 // auto-create.
60 const ConflictProgress* conflict_progress() const; 60 const ConflictProgress* conflict_progress() const;
61 ConflictProgress* mutable_conflict_progress(); 61 ConflictProgress* mutable_conflict_progress();
62 const UpdateProgress* update_progress() const; 62 const UpdateProgress* update_progress() const;
63 UpdateProgress* mutable_update_progress(); 63 UpdateProgress* mutable_update_progress();
64 // TODO(tim): Bug 121521. Remove this unrestricted getter in favor of
65 // something like GetAllGroupsWithUnappliedUpdates.
64 const ConflictProgress* GetUnrestrictedConflictProgress( 66 const ConflictProgress* GetUnrestrictedConflictProgress(
65 ModelSafeGroup group) const; 67 ModelSafeGroup group) const;
66 ConflictProgress* GetUnrestrictedMutableConflictProgressForTest( 68 ConflictProgress* GetUnrestrictedMutableConflictProgressForTest(
67 ModelSafeGroup group); 69 ModelSafeGroup group);
70 // TODO(tim): Bug 121521. Remove this unrestricted getter in favor of
71 // something like GetAllGroupsWithUnappliedUpdates.
68 const UpdateProgress* GetUnrestrictedUpdateProgress( 72 const UpdateProgress* GetUnrestrictedUpdateProgress(
69 ModelSafeGroup group) const; 73 ModelSafeGroup group) const;
70 UpdateProgress* GetUnrestrictedMutableUpdateProgressForTest( 74 UpdateProgress* GetUnrestrictedMutableUpdateProgressForTest(
71 ModelSafeGroup group); 75 ModelSafeGroup group);
72 76
77 // Returns a set of ModelSafeGroups, one for each UpdateProgress that has
78 // unapplied updates.
79 std::set<ModelSafeGroup> GetModelSafeGroupsWithUnappliedUpdates() const;
80
73 // ClientToServer messages. 81 // ClientToServer messages.
74 const ClientToServerMessage& commit_message() { 82 const ClientToServerMessage& commit_message() {
75 return shared_.commit_message; 83 return shared_.commit_message;
76 } 84 }
77 ClientToServerMessage* mutable_commit_message() { 85 ClientToServerMessage* mutable_commit_message() {
78 return &shared_.commit_message; 86 return &shared_.commit_message;
79 } 87 }
80 const ClientToServerResponse& commit_response() const { 88 const ClientToServerResponse& commit_response() const {
81 return shared_.commit_response; 89 return shared_.commit_response;
82 } 90 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 297 }
290 private: 298 private:
291 StatusController* status_; 299 StatusController* status_;
292 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); 300 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction);
293 }; 301 };
294 302
295 } 303 }
296 } 304 }
297 305
298 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ 306 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « sync/sessions/session_state.cc ('k') | sync/sessions/status_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698