| OLD | NEW |
| (Empty) |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H_ | |
| 6 #define COMPONENTS_SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H_ | |
| 7 | |
| 8 #include "components/sync/base/model_type.h" | |
| 9 #include "components/sync/base/syncer_error.h" | |
| 10 #include "components/sync/protocol/sync.pb.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 namespace sessions { | |
| 14 | |
| 15 // Grouping of all state that applies to all model types. Note that some | |
| 16 // components of the global grouping can internally implement finer grained | |
| 17 // scope control, but the top level entity is still a singleton with respect to | |
| 18 // model types. | |
| 19 struct ModelNeutralState { | |
| 20 ModelNeutralState(); | |
| 21 ModelNeutralState(const ModelNeutralState& other); | |
| 22 ~ModelNeutralState(); | |
| 23 | |
| 24 // The set of types for which updates were requested from the server. | |
| 25 ModelTypeSet get_updates_request_types; | |
| 26 | |
| 27 // The set of types for which commits were sent to the server. | |
| 28 ModelTypeSet commit_request_types; | |
| 29 | |
| 30 int num_successful_commits; | |
| 31 | |
| 32 // This is needed for monitoring extensions activity. | |
| 33 int num_successful_bookmark_commits; | |
| 34 | |
| 35 // Download event counters. | |
| 36 int num_updates_downloaded_total; | |
| 37 int num_tombstone_updates_downloaded_total; | |
| 38 int num_reflected_updates_downloaded_total; | |
| 39 | |
| 40 // Update application and conflicts. | |
| 41 int num_updates_applied; | |
| 42 int num_encryption_conflicts; | |
| 43 int num_server_conflicts; | |
| 44 int num_hierarchy_conflicts; | |
| 45 | |
| 46 // Overwrites due to conflict resolution counters. | |
| 47 int num_local_overwrites; | |
| 48 int num_server_overwrites; | |
| 49 | |
| 50 // Records the most recent results of GetKey, PostCommit and GetUpdates | |
| 51 // commands. | |
| 52 SyncerError last_get_key_result; | |
| 53 SyncerError last_download_updates_result; | |
| 54 SyncerError commit_result; | |
| 55 | |
| 56 // Set to true by PostCommitMessageCommand if any commits were successful. | |
| 57 bool items_committed; | |
| 58 }; | |
| 59 | |
| 60 bool HasSyncerError(const ModelNeutralState& state); | |
| 61 | |
| 62 } // namespace sessions | |
| 63 } // namespace syncer | |
| 64 | |
| 65 #endif // COMPONENTS_SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H_ | |
| OLD | NEW |