empty_dm_token_retriever.h 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2021 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_REPORTING_CLIENT_EMPTY_DM_TOKEN_RETRIEVER_H_
  5. #define COMPONENTS_REPORTING_CLIENT_EMPTY_DM_TOKEN_RETRIEVER_H_
  6. #include "components/reporting/client/dm_token_retriever.h"
  7. namespace reporting {
  8. // |EmptyDMTokenRetriever| is a |DMTokenRetriever| that is used for certain
  9. // event types that do not need DM tokens to be retrieved or attached when
  10. // creating a report queue. One such example is for device events, since device
  11. // DM tokens are appended by default during event uploads.
  12. class EmptyDMTokenRetriever : public DMTokenRetriever {
  13. public:
  14. EmptyDMTokenRetriever() = default;
  15. EmptyDMTokenRetriever(const EmptyDMTokenRetriever& other) = delete;
  16. EmptyDMTokenRetriever& operator=(const EmptyDMTokenRetriever& other) = delete;
  17. ~EmptyDMTokenRetriever() override = default;
  18. // Retrieves empty DM token and triggers the corresponding callback with the
  19. // result
  20. void RetrieveDMToken(
  21. DMTokenRetriever::CompletionCallback completion_cb) override;
  22. };
  23. } // namespace reporting
  24. #endif // COMPONENTS_REPORTING_CLIENT_EMPTY_DM_TOKEN_RETRIEVER_H_