chromium/components/sync/base/data_type.cc

// Copyright 2012 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/sync/base/data_type.h"

#include <ostream>

#include "base/containers/fixed_flat_map.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "components/sync/protocol/entity_specifics.pb.h"

namespace syncer {

namespace {

struct DataTypeInfo {};

// Below struct entries are in the same order as their definition in the
// DataType enum. When making changes to this list, don't forget to
//  - update kSpecificsFieldNumberToDataTypeMap below,
//  - update the DataType enum,
//  - update the SyncDataTypes enum in enums.xml, and
//  - update the SyncDataType histogram suffix in histograms.xml.
// Struct field values should be unique across the entire map.
// LINT.IfChange(DataTypeHistogramSuffix)
constexpr auto kDataTypeInfoMap =;
// LINT.ThenChange(/tools/metrics/histograms/metadata/sync/histograms.xml:DataTypeHistogramSuffix)

static_assert;

static_assert;

static_assert;

// kSpecificsFieldNumberToDataTypeMap must exactly match the kDataTypeInfoMap,
// so its size must be syncer::GetNumDataTypes().
//
// NOTE: size here acts as a static assert on the constraint above.
kSpecificsFieldNumberToDataTypeMap;

constexpr kSpecificsFieldNumberToDataTypeMap
    specifics_field_number2data_type =;

}  // namespace

void AddDefaultFieldValue(DataType type, sync_pb::EntitySpecifics* specifics) {}

DataType GetDataTypeFromSpecificsFieldNumber(int field_number) {}

int GetSpecificsFieldNumberFromDataType(DataType data_type) {}

void internal::GetDataTypeSetFromSpecificsFieldNumberListHelper(
    DataTypeSet& data_types,
    int field_number) {}

DataType GetDataTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) {}

DataTypeSet EncryptableUserTypes() {}

const char* DataTypeToDebugString(DataType data_type) {}

const char* DataTypeToHistogramSuffix(DataType data_type) {}

DataTypeForHistograms DataTypeHistogramValue(DataType data_type) {}

int DataTypeToStableIdentifier(DataType data_type) {}

std::string DataTypeSetToDebugString(DataTypeSet data_types) {}

std::ostream& operator<<(std::ostream& out, DataTypeSet data_type_set) {}

std::string DataTypeToProtocolRootTag(DataType data_type) {}

const char* GetDataTypeLowerCaseRootTag(DataType data_type) {}

bool IsRealDataType(DataType data_type) {}

bool IsActOnceDataType(DataType data_type) {}

}  // namespace syncer