chromium/components/subresource_filter/core/common/memory_mapped_ruleset.h

// 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.

#ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_MEMORY_MAPPED_RULESET_H_
#define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_MEMORY_MAPPED_RULESET_H_

#include <stddef.h>
#include <stdint.h>

#include "base/files/file.h"
#include "base/files/memory_mapped_file.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"

namespace subresource_filter {

// A reference-counted wrapper around base::MemoryMappedFile. The |ruleset_file|
// supplied in the constructor is kept memory-mapped and is safe to access until
// the last reference to this instance is dropped.
class MemoryMappedRuleset final : public base::RefCounted<MemoryMappedRuleset> {};

}  // namespace subresource_filter

#endif  // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_MEMORY_MAPPED_RULESET_H_