| OLD | NEW | 
|    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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   48 class StatusController { |   48 class StatusController { | 
|   49  public: |   49  public: | 
|   50   explicit StatusController(const ModelSafeRoutingInfo& routes); |   50   explicit StatusController(const ModelSafeRoutingInfo& routes); | 
|   51   ~StatusController(); |   51   ~StatusController(); | 
|   52  |   52  | 
|   53   // Progress counters.  All const methods may return NULL if the |   53   // Progress counters.  All const methods may return NULL if the | 
|   54   // progress structure doesn't exist, but all non-const methods |   54   // progress structure doesn't exist, but all non-const methods | 
|   55   // auto-create. |   55   // auto-create. | 
|   56   const std::set<syncable::Id>* simple_conflict_ids() const; |   56   const std::set<syncable::Id>* simple_conflict_ids() const; | 
|   57   std::set<syncable::Id>* mutable_simple_conflict_ids(); |   57   std::set<syncable::Id>* mutable_simple_conflict_ids(); | 
|   58   const UpdateProgress* update_progress() const; |  | 
|   59   UpdateProgress* mutable_update_progress(); |  | 
|   60   const std::set<syncable::Id>* GetUnrestrictedSimpleConflictIds( |   58   const std::set<syncable::Id>* GetUnrestrictedSimpleConflictIds( | 
|   61       ModelSafeGroup group) const; |   59       ModelSafeGroup group) const; | 
|   62   const UpdateProgress* GetUnrestrictedUpdateProgress( |  | 
|   63       ModelSafeGroup group) const; |  | 
|   64   UpdateProgress* GetUnrestrictedMutableUpdateProgressForTest( |  | 
|   65       ModelSafeGroup group); |  | 
|   66  |   60  | 
|   67   // ClientToServer messages. |   61   // ClientToServer messages. | 
|   68   const ModelTypeSet updates_request_types() const { |   62   const ModelTypeSet updates_request_types() const { | 
|   69     return model_neutral_.updates_request_types; |   63     return model_neutral_.updates_request_types; | 
|   70   } |   64   } | 
|   71   void set_updates_request_types(ModelTypeSet value) { |   65   void set_updates_request_types(ModelTypeSet value) { | 
|   72     model_neutral_.updates_request_types = value; |   66     model_neutral_.updates_request_types = value; | 
|   73   } |   67   } | 
|   74   const sync_pb::ClientToServerResponse& updates_response() const { |   68   const sync_pb::ClientToServerResponse& updates_response() const { | 
|   75     return model_neutral_.updates_response; |   69     return model_neutral_.updates_response; | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
|  103   // Various conflict counters. |   97   // Various conflict counters. | 
|  104   int num_encryption_conflicts() const; |   98   int num_encryption_conflicts() const; | 
|  105   int num_hierarchy_conflicts() const; |   99   int num_hierarchy_conflicts() const; | 
|  106   int num_server_conflicts() const; |  100   int num_server_conflicts() const; | 
|  107  |  101  | 
|  108   int num_simple_conflicts() const; |  102   int num_simple_conflicts() const; | 
|  109  |  103  | 
|  110   // Aggregate sum of all conflicting items over all conflict types. |  104   // Aggregate sum of all conflicting items over all conflict types. | 
|  111   int TotalNumConflictingItems() const; |  105   int TotalNumConflictingItems() const; | 
|  112  |  106  | 
 |  107   // Number of successfully applied updates. | 
 |  108   int num_updates_applied() const; | 
 |  109  | 
|  113   // Returns the number of updates received from the sync server. |  110   // Returns the number of updates received from the sync server. | 
|  114   int64 CountUpdates() const; |  111   int64 CountUpdates() const; | 
|  115  |  112  | 
|  116   // Returns true if the last download_updates_command received a valid |  113   // Returns true if the last download_updates_command received a valid | 
|  117   // server response. |  114   // server response. | 
|  118   bool download_updates_succeeded() const { |  115   bool download_updates_succeeded() const { | 
|  119     return model_neutral_.last_download_updates_result |  116     return model_neutral_.last_download_updates_result | 
|  120         == SYNCER_OK; |  117         == SYNCER_OK; | 
|  121   } |  118   } | 
|  122  |  119  | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  242   } |  239   } | 
|  243  private: |  240  private: | 
|  244   StatusController* status_; |  241   StatusController* status_; | 
|  245   DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |  242   DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 
|  246 }; |  243 }; | 
|  247  |  244  | 
|  248 }  // namespace sessions |  245 }  // namespace sessions | 
|  249 }  // namespace syncer |  246 }  // namespace syncer | 
|  250  |  247  | 
|  251 #endif  // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |  248 #endif  // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 
| OLD | NEW |