chromium/base/metrics/persistent_sample_map.cc

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

#include "base/metrics/persistent_sample_map.h"

#include "base/atomicops.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/debug/crash_logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"

namespace base {

Count;
Sample;

namespace {

// An iterator for going through a PersistentSampleMap. The logic here is
// identical to that of the iterator for SampleMap but with different data
// structures. Changes here likely need to be duplicated there.
template <typename T, typename I>
class IteratorTemplate : public SampleCountIterator {};

SampleToCountMap;
PersistentSampleMapIterator;

template <>
PersistentSampleMapIterator::~IteratorTemplate() = default;

// Get() for an iterator of a PersistentSampleMap.
template <>
void PersistentSampleMapIterator::Get(Sample* min, int64_t* max, Count* count) {}

ExtractingPersistentSampleMapIterator;

template <>
ExtractingPersistentSampleMapIterator::~IteratorTemplate() {}

// Get() for an extracting iterator of a PersistentSampleMap.
template <>
void ExtractingPersistentSampleMapIterator::Get(Sample* min,
                                                int64_t* max,
                                                Count* count) {}

// This structure holds an entry for a PersistentSampleMap within a persistent
// memory allocator. The "id" must be unique across all maps held by an
// allocator or they will get attached to the wrong sample map.
struct SampleRecord {};

}  // namespace

PersistentSampleMap::PersistentSampleMap(
    uint64_t id,
    PersistentHistogramAllocator* allocator,
    Metadata* meta)
    :{}

PersistentSampleMap::~PersistentSampleMap() = default;

void PersistentSampleMap::Accumulate(Sample value, Count count) {}

Count PersistentSampleMap::GetCount(Sample value) const {}

Count PersistentSampleMap::TotalCount() const {}

std::unique_ptr<SampleCountIterator> PersistentSampleMap::Iterator() const {}

std::unique_ptr<SampleCountIterator> PersistentSampleMap::ExtractingIterator() {}

bool PersistentSampleMap::IsDefinitelyEmpty() const {}

// static
PersistentMemoryAllocator::Reference
PersistentSampleMap::GetNextPersistentRecord(
    PersistentMemoryAllocator::Iterator& iterator,
    uint64_t* sample_map_id,
    Sample* value) {}

// static
PersistentMemoryAllocator::Reference
PersistentSampleMap::CreatePersistentRecord(
    PersistentMemoryAllocator* allocator,
    uint64_t sample_map_id,
    Sample value) {}

bool PersistentSampleMap::AddSubtractImpl(SampleCountIterator* iter,
                                          Operator op) {}

Count* PersistentSampleMap::GetSampleCountStorage(Sample value) {}

Count* PersistentSampleMap::GetOrCreateSampleCountStorage(Sample value) {}

PersistentSampleMapRecords* PersistentSampleMap::GetRecords() {}

Count* PersistentSampleMap::ImportSamples(std::optional<Sample> until_value) {}

}  // namespace base