invalidation_logger_observer.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2014 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_INVALIDATION_IMPL_INVALIDATION_LOGGER_OBSERVER_H_
  5. #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_LOGGER_OBSERVER_H_
  6. #include <set>
  7. #include <string>
  8. #include "base/values.h"
  9. #include "components/invalidation/public/invalidation_util.h"
  10. #include "components/invalidation/public/invalidator_state.h"
  11. namespace base {
  12. class Time;
  13. } // namespace base
  14. namespace invalidation {
  15. class TopicInvalidationMap;
  16. // This class provides the possibility to register as an observer for the
  17. // InvalidationLogger notifications whenever an InvalidationService changes
  18. // its internal state.
  19. // (i.e. A new registration, a new invalidation, a GCM state change)
  20. class InvalidationLoggerObserver {
  21. public:
  22. virtual void OnRegistrationChange(
  23. const std::set<std::string>& registered_handlers) = 0;
  24. virtual void OnStateChange(const InvalidatorState& new_state,
  25. const base::Time& last_change_timestamp) = 0;
  26. virtual void OnUpdatedTopics(const std::string& handler_name,
  27. const TopicCountMap& details) = 0;
  28. virtual void OnDebugMessage(const base::Value::Dict& details) = 0;
  29. virtual void OnInvalidation(const TopicInvalidationMap& details) = 0;
  30. virtual void OnDetailedStatus(base::Value::Dict details) = 0;
  31. protected:
  32. virtual ~InvalidationLoggerObserver() = default;
  33. };
  34. } // namespace invalidation
  35. #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_LOGGER_OBSERVER_H_