Index: sync/sessions/status_controller.h |
diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h |
index 1465dbfdf64afc9f16a9e171dc78c5fa5202f90f..b33a1487fc7e243d2f1fb6a8179cf09e9e5d83ff 100644 |
--- a/sync/sessions/status_controller.h |
+++ b/sync/sessions/status_controller.h |
@@ -3,20 +3,12 @@ |
// found in the LICENSE file. |
// StatusController handles all counter and status related number crunching and |
-// state tracking on behalf of a SyncSession. It 'controls' the model data |
-// defined in session_state.h. The most important feature of StatusController |
-// is the ScopedModelSafetyRestriction. When one of these is active, the |
-// underlying data set exposed via accessors is swapped out to the appropriate |
-// set for the restricted ModelSafeGroup behind the scenes. For example, if |
-// GROUP_UI is set, then accessors such as conflict_progress() and commit_ids() |
-// are implicitly restricted to returning only data pertaining to GROUP_UI. |
-// You can see which parts of status fall into this "restricted" category, or |
-// the global "shared" category for all model types, by looking at the struct |
-// declarations in session_state.h. If these accessors are invoked without a |
-// restriction in place, this is a violation and will cause debug assertions |
-// to surface improper use of the API in development. Likewise for |
-// invocation of "shared" accessors when a restriction is in place; for |
-// safety's sake, an assertion will fire. |
+// state tracking on behalf of a SyncSession. |
+// |
+// The most important feature of StatusController is the |
+// ScopedModelSafetyRestriction. Some of its functions expose per-thread state, |
+// and can be called only when the SafetyRestriction is in effect. Other parts |
+// of its state are global, and do not require the restriction. |
// |
// NOTE: There is no concurrent access protection provided by this class. It |
// assumes one single thread is accessing this class for each unique |
@@ -40,7 +32,6 @@ |
#include "base/time.h" |
#include "sync/internal_api/public/sessions/model_neutral_state.h" |
#include "sync/sessions/ordered_commit_set.h" |
-#include "sync/sessions/session_state.h" |
namespace syncer { |
namespace sessions { |
@@ -50,14 +41,6 @@ class StatusController { |
explicit StatusController(const ModelSafeRoutingInfo& routes); |
~StatusController(); |
- // Progress counters. All const methods may return NULL if the |
- // progress structure doesn't exist, but all non-const methods |
- // auto-create. |
- const std::set<syncable::Id>* simple_conflict_ids() const; |
- std::set<syncable::Id>* mutable_simple_conflict_ids(); |
- const std::set<syncable::Id>* GetUnrestrictedSimpleConflictIds( |
- ModelSafeGroup group) const; |
- |
// ClientToServer messages. |
const ModelTypeSet updates_request_types() const { |
return model_neutral_.updates_request_types; |
@@ -84,29 +67,19 @@ class StatusController { |
return commit_set.GetCommitIdProjection(group_restriction_); |
} |
- // Control parameters for sync cycles. |
- bool conflicts_resolved() const { |
- return model_neutral_.conflicts_resolved; |
- } |
- |
- // If a GetUpdates for any data type resulted in downloading an update that |
- // is in conflict, this method returns true. |
- // Note: this includes unresolvable conflicts. |
- bool HasConflictingUpdates() const; |
- |
// Various conflict counters. |
int num_encryption_conflicts() const; |
int num_hierarchy_conflicts() const; |
int num_server_conflicts() const; |
- int num_simple_conflicts() const; |
- |
// Aggregate sum of all conflicting items over all conflict types. |
int TotalNumConflictingItems() const; |
// Number of successfully applied updates. |
int num_updates_applied() const; |
+ int num_server_overwrites() const; |
+ |
// Returns the number of updates received from the sync server. |
int64 CountUpdates() const; |
@@ -151,17 +124,13 @@ class StatusController { |
void increment_num_reflected_updates_downloaded_by(int value); |
// Update application and conflict resolution counters. |
- void increment_num_updates_applied(); |
- void increment_num_encryption_conflicts(); |
+ void increment_num_updates_applied_by(int value); |
+ void increment_num_encryption_conflicts_by(int value); |
+ void increment_num_hierarchy_conflicts_by(int value); |
void increment_num_server_conflicts(); |
- void set_num_hierarchy_conflicts(int value); |
void increment_num_local_overwrites(); |
void increment_num_server_overwrites(); |
- // TODO(rlarocque): Remove these after conflict resolution refactor. |
- void update_conflicts_resolved(bool resolved); |
- void reset_conflicts_resolved(); |
- |
// Commit counters. |
void increment_num_successful_commits(); |
void increment_num_successful_bookmark_commits(); |
@@ -196,19 +165,7 @@ class StatusController { |
return group_restriction() == it->second; |
} |
- // Returns the state, if it exists, or NULL otherwise. |
- const PerModelSafeGroupState* GetModelSafeGroupState( |
- bool restrict, ModelSafeGroup group) const; |
- |
- // Helper to lazily create objects for per-ModelSafeGroup state. |
- PerModelSafeGroupState* GetOrCreateModelSafeGroupState( |
- bool restrict, ModelSafeGroup group); |
- |
ModelNeutralState model_neutral_; |
- std::map<ModelSafeGroup, PerModelSafeGroupState*> per_model_group_; |
- |
- STLValueDeleter<std::map<ModelSafeGroup, PerModelSafeGroupState*> > |
- per_model_group_deleter_; |
// Used to fail read/write operations on state that don't obey the current |
// active ModelSafeWorker contract. |