#include "components/invalidation/impl/fcm_invalidation_listener.h"
#include <optional>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/task/single_thread_task_runner.h"
#include "components/invalidation/public/invalidation.h"
#include "components/invalidation/public/invalidation_util.h"
#include "components/invalidation/public/invalidator_state.h"
namespace invalidation {
namespace {
void Upsert(std::map<Topic, Invalidation>& map,
const std::optional<Invalidation>& invalidation) { … }
}
FCMInvalidationListener::FCMInvalidationListener(
std::unique_ptr<FCMSyncNetworkChannel> network_channel)
: … { … }
FCMInvalidationListener::~FCMInvalidationListener() { … }
std::unique_ptr<FCMInvalidationListener> FCMInvalidationListener::Create(
std::unique_ptr<FCMSyncNetworkChannel> network_channel) { … }
void FCMInvalidationListener::Start(
Delegate* delegate,
std::unique_ptr<PerUserTopicSubscriptionManager>
per_user_topic_subscription_manager) { … }
void FCMInvalidationListener::UpdateInterestedTopics(const TopicMap& topics) { … }
void FCMInvalidationListener::ClearInstanceIDToken() { … }
void FCMInvalidationListener::InvalidationReceived(
const std::string& payload,
const std::string& private_topic,
const std::string& public_topic,
int64_t version) { … }
void FCMInvalidationListener::DispatchInvalidation(
const Invalidation& invalidation) { … }
std::optional<Invalidation> FCMInvalidationListener::EmitInvalidation(
const Invalidation& invalidation) { … }
void FCMInvalidationListener::TokenReceived(
const std::string& instance_id_token) { … }
void FCMInvalidationListener::DoSubscriptionUpdate() { … }
void FCMInvalidationListener::Stop() { … }
InvalidatorState FCMInvalidationListener::GetState() const { … }
void FCMInvalidationListener::EmitStateChange() { … }
void FCMInvalidationListener::OnFCMChannelStateChanged(FcmChannelState state) { … }
void FCMInvalidationListener::OnSubscriptionChannelStateChanged(
SubscriptionChannelState state) { … }
void FCMInvalidationListener::OnSubscriptionRequestFinished(
Topic topic,
PerUserTopicSubscriptionManager::RequestType request_type,
Status code) { … }
}