chromium/google_apis/gcm/base/mcs_util.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "google_apis/gcm/base/mcs_util.h"

#include <stddef.h>

#include "base/check_op.h"
#include "base/format_macros.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/time/clock.h"
#include "base/time/time.h"

namespace gcm {

namespace {

// Type names corresponding to MCSProtoTags. Useful for identifying what type
// of MCS protobuf is contained within a google::protobuf::MessageLite object.
// WARNING: must match the order in MCSProtoTag.
const char* const kProtoNames[] =;
static_assert;

const char kLoginId[] =;
const char kLoginDomain[] =;
const char kLoginDeviceIdPrefix[] =;
const char kLoginSettingDefaultName[] =;
const char kLoginSettingDefaultValue[] =;

// Maximum amount of time to save an unsent outgoing message for.
const int kMaxTTLSeconds =;  // 1 day.

}  // namespace

std::unique_ptr<mcs_proto::LoginRequest> BuildLoginRequest(
    uint64_t auth_id,
    uint64_t auth_token,
    const std::string& version_string) {}

std::unique_ptr<mcs_proto::IqStanza> BuildStreamAck() {}

std::unique_ptr<mcs_proto::IqStanza> BuildSelectiveAck(
    const std::vector<std::string>& acked_ids) {}

// Utility method to build a google::protobuf::MessageLite object from a MCS
// tag.
std::unique_ptr<google::protobuf::MessageLite> BuildProtobufFromTag(
    uint8_t tag) {}

// Utility method to extract a MCS tag from a google::protobuf::MessageLite
// object.
int GetMCSProtoTag(const google::protobuf::MessageLite& message) {}

std::string GetPersistentId(const google::protobuf::MessageLite& protobuf) {}

void SetPersistentId(const std::string& persistent_id,
                     google::protobuf::MessageLite* protobuf) {}

uint32_t GetLastStreamIdReceived(
    const google::protobuf::MessageLite& protobuf) {}

void SetLastStreamIdReceived(uint32_t val,
                             google::protobuf::MessageLite* protobuf) {}

bool HasTTLExpired(const google::protobuf::MessageLite& protobuf,
                   base::Clock* clock) {}

int GetTTL(const google::protobuf::MessageLite& protobuf) {}

bool IsImmediateAckRequested(const google::protobuf::MessageLite& protobuf) {}

}  // namespace gcm