#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_PERSISTENT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_PERSISTENT_H_
#include "third_party/blink/renderer/platform/heap/heap_buildflags.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/hash_traits.h"
#include "third_party/blink/renderer/platform/wtf/type_traits.h"
#include "third_party/blink/renderer/platform/wtf/vector_traits.h"
#include "v8/include/cppgc/cross-thread-persistent.h"
#include "v8/include/cppgc/persistent.h"
#include "v8/include/cppgc/source-location.h"
#if BUILDFLAG(VERBOSE_PERSISTENT)
#define PERSISTENT_LOCATION_FROM_HERE …
#else
#define PERSISTENT_LOCATION_FROM_HERE …
#endif
namespace blink {
Persistent;
WeakPersistent;
PersistentLocation;
template <typename T>
Persistent<T> WrapPersistent(
T* value,
const PersistentLocation& loc = PERSISTENT_LOCATION_FROM_HERE) { … }
template <typename T>
WeakPersistent<T> WrapWeakPersistent(
T* value,
const PersistentLocation& loc = PERSISTENT_LOCATION_FROM_HERE) { … }
template <typename U, typename T, typename weakness>
cppgc::internal::BasicPersistent<U, weakness> DownCast(
const cppgc::internal::BasicPersistent<T, weakness>& p) { … }
template <typename U, typename T, typename weakness>
cppgc::internal::BasicCrossThreadPersistent<U, weakness> DownCast(
const cppgc::internal::BasicCrossThreadPersistent<T, weakness>& p) { … }
template <typename T,
typename = std::enable_if_t<WTF::IsGarbageCollectedType<T>::value>>
Persistent<T> WrapPersistentIfNeeded(T* value) { … }
template <typename T>
T& WrapPersistentIfNeeded(T& value) { … }
}
namespace WTF {
template <typename T>
struct PersistentVectorTraitsBase : VectorTraitsBase<T> { … };
VectorTraits<blink::Persistent<T>>;
VectorTraits<blink::WeakPersistent<T>>;
template <typename T, typename PersistentType>
struct BasePersistentHashTraits : SimpleClassHashTraits<PersistentType> { … };
HashTraits<blink::Persistent<T>>;
HashTraits<blink::WeakPersistent<T>>;
}
namespace base {
template <typename T>
struct IsWeakReceiver;
IsWeakReceiver<blink::WeakPersistent<T>>;
template <typename>
struct MaybeValidTraits;
MaybeValidTraits<blink::WeakPersistent<T>>;
}
#endif