sync_status.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_ENGINE_SYNC_STATUS_H_
  5. #define COMPONENTS_SYNC_ENGINE_SYNC_STATUS_H_
  6. #include <string>
  7. #include "base/time/time.h"
  8. #include "components/sync/base/model_type.h"
  9. #include "components/sync/base/passphrase_enums.h"
  10. #include "components/sync/engine/sync_encryption_handler.h"
  11. #include "components/sync/protocol/nigori_specifics.pb.h"
  12. #include "components/sync/protocol/sync_protocol_error.h"
  13. namespace syncer {
  14. // Status encapsulates detailed state about the internals of the SyncManager.
  15. //
  16. // This struct is closely tied to the AllStatus object which uses instances of
  17. // it to track and report on the sync engine's internal state, and the functions
  18. // in sync_ui_util.cc which convert the contents of this struct into a
  19. // DictionaryValue used to populate the chrome://sync-internals summary tab.
  20. struct SyncStatus {
  21. SyncStatus();
  22. SyncStatus(const SyncStatus& other);
  23. ~SyncStatus();
  24. // TODO(akalin): Replace this with a NotificationsDisabledReason
  25. // variable.
  26. // True only if subscribed for notifications.
  27. bool notifications_enabled = false;
  28. // Notifications counters updated by the actions in synapi.
  29. int notifications_received = 0;
  30. SyncProtocolError sync_protocol_error;
  31. // Number of items the server refused to commit due to conflict during most
  32. // recent sync cycle.
  33. int server_conflicts = 0;
  34. // Number of items successfully committed during most recent sync cycle.
  35. int committed_count = 0;
  36. // Whether a sync cycle is going on right now.
  37. bool syncing = false;
  38. // Total updates received by the syncer since browser start.
  39. int updates_received = 0;
  40. // Of updates_received, how many were tombstones.
  41. int tombstone_updates_received = 0;
  42. // Total successful commits.
  43. int num_commits_total = 0;
  44. // Encryption related.
  45. ModelTypeSet encrypted_types;
  46. bool cryptographer_can_encrypt = false;
  47. bool crypto_has_pending_keys = false;
  48. bool has_keystore_key = false;
  49. base::Time keystore_migration_time;
  50. PassphraseType passphrase_type = PassphraseType::kImplicitPassphrase;
  51. sync_pb::NigoriSpecifics::TrustedVaultDebugInfo trusted_vault_debug_info;
  52. // Per-datatype throttled status.
  53. ModelTypeSet throttled_types;
  54. // Per-datatype backed off status.
  55. ModelTypeSet backed_off_types;
  56. std::string cache_guid;
  57. // The unique identifier for the invalidation client.
  58. std::string invalidator_client_id;
  59. // Time of next retry if sync scheduler is throttled or in backoff.
  60. base::Time retry_time;
  61. // The location of the local sync backend db file if local sync is enabled.
  62. std::string local_sync_folder;
  63. };
  64. } // namespace syncer
  65. #endif // COMPONENTS_SYNC_ENGINE_SYNC_STATUS_H_