chromium/components/sharing_message/sharing_fcm_handler.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sharing_message/sharing_fcm_handler.h"

#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/sharing_message/features.h"
#include "components/sharing_message/proto/sharing_message_type.pb.h"
#include "components/sharing_message/sharing_constants.h"
#include "components/sharing_message/sharing_fcm_sender.h"
#include "components/sharing_message/sharing_handler_registry.h"
#include "components/sharing_message/sharing_message_handler.h"
#include "components/sharing_message/sharing_metrics.h"
#include "components/sharing_message/sharing_utils.h"
#include "components/sync_device_info/device_info_tracker.h"
#include "third_party/re2/src/re2/re2.h"

namespace {

// The regex captures
// Group 1: type:timesmap
// Group 2: userId#
// Group 3: hashcode
const char kMessageIdRegexPattern[] =;

// Returns message_id with userId stripped.
// FCM message_id is a persistent id in format of:
//     0:1416811810537717%0#e7a71353318775c7
//     ^          ^       ^          ^
// type :    timestamp % userId # hashcode
// As per go/persistent-id, userId# is optional, and should be stripped
// comparing persistent ids.
// Retrns |message_id| with userId stripped, or |message_id| if it is not
// confined to the format.
std::string GetStrippedMessageId(const std::string& message_id) {}

}  // namespace

SharingFCMHandler::SharingFCMHandler(
    gcm::GCMDriver* gcm_driver,
    syncer::DeviceInfoTracker* device_info_tracker,
    SharingFCMSender* sharing_fcm_sender,
    SharingHandlerRegistry* handler_registry)
    :{}

SharingFCMHandler::~SharingFCMHandler() {}

void SharingFCMHandler::StartListening() {}

void SharingFCMHandler::StopListening() {}

void SharingFCMHandler::OnMessagesDeleted(const std::string& app_id) {}

void SharingFCMHandler::ShutdownHandler() {}

void SharingFCMHandler::OnMessage(const std::string& app_id,
                                  const gcm::IncomingMessage& message) {}

void SharingFCMHandler::OnSendAcknowledged(const std::string& app_id,
                                           const std::string& message_id) {}

void SharingFCMHandler::OnSendError(
    const std::string& app_id,
    const gcm::GCMClient::SendErrorDetails& details) {}

void SharingFCMHandler::OnStoreReset() {}

std::optional<components_sharing_message::FCMChannelConfiguration>
SharingFCMHandler::GetFCMChannel(
    const components_sharing_message::SharingMessage& original_message) {}

std::optional<components_sharing_message::ServerChannelConfiguration>
SharingFCMHandler::GetServerChannel(
    const components_sharing_message::SharingMessage& original_message) {}

SharingDevicePlatform SharingFCMHandler::GetSenderPlatform(
    const components_sharing_message::SharingMessage& original_message) {}

void SharingFCMHandler::SendAckMessage(
    std::string original_message_id,
    sharing_message::MessageType original_message_type,
    std::optional<components_sharing_message::FCMChannelConfiguration>
        fcm_channel,
    std::optional<components_sharing_message::ServerChannelConfiguration>
        server_channel,
    SharingDevicePlatform sender_device_type,
    std::unique_ptr<components_sharing_message::ResponseMessage> response) {}

void SharingFCMHandler::OnAckMessageSent(
    std::string original_message_id,
    sharing_message::MessageType original_message_type,
    SharingDevicePlatform sender_device_type,
    int trace_id,
    SharingSendMessageResult result,
    std::optional<std::string> message_id,
    SharingChannelType channel_type) {}