#include "components/invalidation/impl/fcm_invalidation_service.h"
#include <set>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/strings/strcat.h"
#include "components/gcm_driver/instance_id/instance_id_driver.h"
#include "components/invalidation/impl/fcm_network_handler.h"
#include "components/invalidation/impl/invalidation_prefs.h"
#include "components/invalidation/public/invalidation_util.h"
#include "components/invalidation/public/invalidator_state.h"
#include "components/prefs/scoped_user_pref_update.h"
namespace invalidation {
namespace {
constexpr char kApplicationName[] = …;
constexpr char kDisableFcmInvalidationsSwitch[] = …;
constexpr char kDeprecatedSyncInvalidationGCMSenderId[] = …;
}
FCMInvalidationService::FCMInvalidationService(
IdentityProvider* identity_provider,
FCMNetworkHandlerCallback fcm_network_handler_callback,
FCMInvalidationListenerCallback fcm_invalidation_listener_callback,
PerUserTopicSubscriptionManagerCallback
per_user_topic_subscription_manager_callback,
instance_id::InstanceIDDriver* instance_id_driver,
PrefService* pref_service,
const std::string& sender_id)
: … { … }
FCMInvalidationService::~FCMInvalidationService() { … }
void FCMInvalidationService::Init() { … }
void FCMInvalidationService::RegisterPrefs(PrefRegistrySimple* registry) { … }
void FCMInvalidationService::ClearDeprecatedPrefs(PrefService* prefs) { … }
void FCMInvalidationService::AddObserver(InvalidationHandler* handler) { … }
bool FCMInvalidationService::HasObserver(
const InvalidationHandler* handler) const { … }
bool FCMInvalidationService::UpdateInterestedTopics(
InvalidationHandler* handler,
const TopicSet& topic_set) { … }
void FCMInvalidationService::RemoveObserver(
const InvalidationHandler* handler) { … }
InvalidatorState FCMInvalidationService::GetInvalidatorState() const { … }
std::string FCMInvalidationService::GetInvalidatorClientId() const { … }
void FCMInvalidationService::OnActiveAccountLogin() { … }
void FCMInvalidationService::OnActiveAccountRefreshTokenUpdated() { … }
void FCMInvalidationService::OnActiveAccountLogout() { … }
std::optional<Invalidation> FCMInvalidationService::OnInvalidate(
const Invalidation& invalidation) { … }
void FCMInvalidationService::OnInvalidatorStateChange(InvalidatorState state) { … }
void FCMInvalidationService::OnSuccessfullySubscribed(const Topic& topic) { … }
bool FCMInvalidationService::IsStarted() const { … }
bool FCMInvalidationService::IsReadyToStart() { … }
void FCMInvalidationService::StartInvalidator() { … }
void FCMInvalidationService::StopInvalidator() { … }
void FCMInvalidationService::StopInvalidatorPermanently() { … }
void FCMInvalidationService::PopulateClientID() { … }
void FCMInvalidationService::ResetClientID() { … }
void FCMInvalidationService::OnInstanceIDReceived(
const std::string& instance_id) { … }
void FCMInvalidationService::OnDeleteInstanceIDCompleted(
instance_id::InstanceID::Result) { … }
void FCMInvalidationService::DoUpdateSubscribedTopicsIfNeeded() { … }
const std::string FCMInvalidationService::GetApplicationName() { … }
}