// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_INVALIDATION_INVALIDATION_LISTENER_H_ #define COMPONENTS_INVALIDATION_INVALIDATION_LISTENER_H_ #include <memory> #include <string> #include "base/observer_list_types.h" #include "base/time/time.h" #include "components/invalidation/public/invalidation.h" namespace gcm { class GCMDriver; } namespace instance_id { class InstanceIDDriver; } namespace invalidation { // For the migration from topic based (Fandango) invalidations to direct // message invalidations, this is a thin wrapper around the topic based // invalidations. The only reason for having this is to provide the `type` // method in the interface (as opposed to using the `topic` method). // TODO(b/350013667) Once we fully migrated to direct message // invalidations, we can delete `invalidation::Invalidation` and rename this to // Invalidation. class DirectInvalidation : public invalidation::Invalidation { … }; // Interface to handle obtained registration tokens. class RegistrationTokenHandler { … }; // Represents invalidations availability status. enum class InvalidationsExpected { … }; // The `InvalidationListener` is receiving invalidation data messages via FM // (formerly known as FCM formerly known as GCM). It also obtains the FM app // registration token, aka app instance id. // // Expected elements of FM message data: // { // "type": string, # used to route the message to the correct observer. // "version" : int, // "payload" : string // } // // Note that invalidation messages might get dropped while the service is not // listening. class InvalidationListener { … }; } // namespace invalidation #endif // COMPONENTS_INVALIDATION_INVALIDATION_LISTENER_H_