chromium/components/invalidation/impl/fcm_invalidation_listener.h

// Copyright 2018 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_IMPL_FCM_INVALIDATION_LISTENER_H_
#define COMPONENTS_INVALIDATION_IMPL_FCM_INVALIDATION_LISTENER_H_

#include <map>
#include <memory>
#include <optional>

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/invalidation/impl/channels_states.h"
#include "components/invalidation/impl/fcm_sync_network_channel.h"
#include "components/invalidation/impl/per_user_topic_subscription_manager.h"
#include "components/invalidation/public/invalidation.h"
#include "components/invalidation/public/invalidation_util.h"
#include "components/invalidation/public/invalidator_state.h"

namespace invalidation {

class Invalidation;

// Receives InstanceID tokens and actual invalidations from FCM via
// FCMSyncNetworkChannel, and dispatches them to its delegate (in practice, the
// FCMInvalidationService). Stores invalidations in memory if no handler is
// currently interested in the topic.
// Also tracks the set of topics we're interested in (only invalidations for
// these topics will get dispatched) and passes them to
// PerUserTopicSubscriptionManager for subscription or unsubscription.
class FCMInvalidationListener
    : public FCMSyncNetworkChannel::Observer,
      public PerUserTopicSubscriptionManager::Observer {};

}  // namespace invalidation

#endif  // COMPONENTS_INVALIDATION_IMPL_FCM_INVALIDATION_LISTENER_H_