chromium/third_party/blink/renderer/core/layout/inline/inline_item_span.h

// Copyright 2021 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

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_SPAN_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_SPAN_H_

#include "third_party/blink/renderer/core/layout/inline/inline_items_data.h"

namespace blink {
// |InlineItemSpan| performs like base::span<InlineItem> but stores a
// pointer to |InlineItemsData|, not |HeapVector<InlineItem>| in
// |InlineItemsData|, to keep it alive. |HeapVector<InlineItem>| allocated
// in |InlineItemsData| is deleted in |InlineItemsData|'s destructor even
// if there is any pointer to the vector, and storing a pointer to it can
// cause use-after-free bugs.
struct InlineItemSpan final {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_SPAN_H_