chromium/third_party/ipcz/src/ipcz/ref_counted_fragment.h

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

#ifndef IPCZ_SRC_IPCZ_REF_COUNTED_FRAGMENT_H_
#define IPCZ_SRC_IPCZ_REF_COUNTED_FRAGMENT_H_

#include <atomic>

#include "ipcz/ipcz.h"
#include "util/ref_counted.h"

namespace ipcz {

// A RefCountedFragment is an object allocated within a shared Fragment from
// NodeLinkMemory, and which is automatially freed when its last reference is
// released. Consumers can hold onto references to RefCountedFragment objects
// by holding a FragmentRef.
struct IPCZ_ALIGN(4) RefCountedFragment {};

}  // namespace ipcz

#endif  // IPCZ_SRC_IPCZ_REF_COUNTED_FRAGMENT_H_