sync_token_status.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2018 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_DRIVER_SYNC_TOKEN_STATUS_H_
  5. #define COMPONENTS_SYNC_DRIVER_SYNC_TOKEN_STATUS_H_
  6. #include "base/time/time.h"
  7. #include "components/sync/engine/connection_status.h"
  8. #include "google_apis/gaia/google_service_auth_error.h"
  9. namespace syncer {
  10. // Status of sync server connection, OAuth2 access token and token request.
  11. struct SyncTokenStatus {
  12. SyncTokenStatus() = default;
  13. ~SyncTokenStatus() = default;
  14. // Sync server connection status reported by the sync engine.
  15. base::Time connection_status_update_time;
  16. ConnectionStatus connection_status = CONNECTION_NOT_ATTEMPTED;
  17. // The last times when an OAuth2 access token was requested, and when a
  18. // response was received (whether successful or not).
  19. base::Time token_request_time;
  20. base::Time token_response_time;
  21. // The error we received for the last OAuth2 access token request (or
  22. // AuthErrorNone() if it succeeded).
  23. GoogleServiceAuthError last_get_token_error;
  24. // Whether we currently have an OAuth2 access token.
  25. bool has_token = false;
  26. // The time when the next token request is scheduled, or a null time if no
  27. // request is scheduled.
  28. base::Time next_token_request_time;
  29. };
  30. } // namespace syncer
  31. #endif // COMPONENTS_SYNC_DRIVER_SYNC_TOKEN_STATUS_H_