#include "components/gcm_driver/fake_gcm_client.h"
#include <stddef.h>
#include <algorithm>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "google_apis/gcm/base/encryptor.h"
#include "google_apis/gcm/engine/account_mapping.h"
#include "net/base/ip_endpoint.h"
namespace gcm {
std::string FakeGCMClient::GenerateGCMRegistrationID(
const std::vector<std::string>& sender_ids) { … }
std::string FakeGCMClient::GenerateInstanceIDToken(
const std::string& authorized_entity, const std::string& scope) { … }
FakeGCMClient::FakeGCMClient(
const scoped_refptr<base::SequencedTaskRunner>& ui_thread,
const scoped_refptr<base::SequencedTaskRunner>& io_thread)
: … { … }
FakeGCMClient::~FakeGCMClient() { … }
void FakeGCMClient::Initialize(
const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
scoped_refptr<base::SequencedTaskRunner> io_task_runner,
base::RepeatingCallback<void(
mojo::PendingReceiver<network::mojom::ProxyResolvingSocketFactory>)>
get_socket_factory_callback,
const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
network::NetworkConnectionTracker* network_connection_tracker,
std::unique_ptr<Encryptor> encryptor,
Delegate* delegate) { … }
void FakeGCMClient::Start(StartMode start_mode) { … }
void FakeGCMClient::DoStart() { … }
void FakeGCMClient::Stop() { … }
void FakeGCMClient::Register(
scoped_refptr<RegistrationInfo> registration_info) { … }
bool FakeGCMClient::ValidateRegistration(
scoped_refptr<RegistrationInfo> registration_info,
const std::string& registration_id) { … }
void FakeGCMClient::Unregister(
scoped_refptr<RegistrationInfo> registration_info) { … }
void FakeGCMClient::Send(const std::string& app_id,
const std::string& receiver_id,
const OutgoingMessage& message) { … }
void FakeGCMClient::RecordDecryptionFailure(const std::string& app_id,
GCMDecryptionResult result) { … }
void FakeGCMClient::SetRecording(bool recording) { … }
void FakeGCMClient::ClearActivityLogs() { … }
GCMClient::GCMStatistics FakeGCMClient::GetStatistics() const { … }
void FakeGCMClient::SetAccountTokens(
const std::vector<AccountTokenInfo>& account_tokens) { … }
void FakeGCMClient::UpdateAccountMapping(
const AccountMapping& account_mapping) { … }
void FakeGCMClient::RemoveAccountMapping(const CoreAccountId& account_id) { … }
void FakeGCMClient::SetLastTokenFetchTime(const base::Time& time) { … }
void FakeGCMClient::UpdateHeartbeatTimer(
std::unique_ptr<base::RetainingOneShotTimer> timer) { … }
void FakeGCMClient::AddInstanceIDData(const std::string& app_id,
const std::string& instance_id,
const std::string& extra_data) { … }
void FakeGCMClient::RemoveInstanceIDData(const std::string& app_id) { … }
void FakeGCMClient::GetInstanceIDData(const std::string& app_id,
std::string* instance_id,
std::string* extra_data) { … }
void FakeGCMClient::AddHeartbeatInterval(const std::string& scope,
int interval_ms) { … }
void FakeGCMClient::RemoveHeartbeatInterval(const std::string& scope) { … }
void FakeGCMClient::PerformDelayedStart() { … }
void FakeGCMClient::ReceiveMessage(const std::string& app_id,
const IncomingMessage& message) { … }
void FakeGCMClient::DeleteMessages(const std::string& app_id) { … }
void FakeGCMClient::Started() { … }
void FakeGCMClient::RegisterFinished(
scoped_refptr<RegistrationInfo> registration_info,
const std::string& registrion_id) { … }
void FakeGCMClient::UnregisterFinished(
scoped_refptr<RegistrationInfo> registration_info) { … }
void FakeGCMClient::SendFinished(const std::string& app_id,
const OutgoingMessage& message) { … }
void FakeGCMClient::MessageReceived(const std::string& app_id,
const IncomingMessage& message) { … }
void FakeGCMClient::MessagesDeleted(const std::string& app_id) { … }
void FakeGCMClient::MessageSendError(
const std::string& app_id,
const GCMClient::SendErrorDetails& send_error_details) { … }
void FakeGCMClient::SendAcknowledgement(const std::string& app_id,
const std::string& message_id) { … }
}