| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_MEMBER_H_ |
| #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_MEMBER_H_ |
| |
| #include "third_party/blink/renderer/platform/heap/thread_state.h" |
| #include "v8/include/cppgc/member.h" |
| |
| namespace blink { |
| |
| template <typename T> |
| using Member = cppgc::Member<T>; |
| |
| template <typename T> |
| using WeakMember = cppgc::WeakMember<T>; |
| |
| template <typename T> |
| using UntracedMember = cppgc::UntracedMember<T>; |
| |
| template <typename T> |
| inline bool IsHashTableDeletedValue(const Member<T>& m) { |
| return m == cppgc::kSentinelPointer; |
| } |
| |
| constexpr auto kMemberDeletedValue = cppgc::kSentinelPointer; |
| |
| template <typename T> |
| struct ThreadingTrait<blink::Member<T>> { |
| STATIC_ONLY(ThreadingTrait); |
| static constexpr ThreadAffinity kAffinity = ThreadingTrait<T>::kAffinity; |
| }; |
| |
| template <typename T> |
| struct ThreadingTrait<blink::WeakMember<T>> { |
| STATIC_ONLY(ThreadingTrait); |
| static constexpr ThreadAffinity kAffinity = ThreadingTrait<T>::kAffinity; |
| }; |
| |
| template <typename T> |
| struct ThreadingTrait<blink::UntracedMember<T>> { |
| STATIC_ONLY(ThreadingTrait); |
| static constexpr ThreadAffinity kAffinity = ThreadingTrait<T>::kAffinity; |
| }; |
| |
| } // namespace blink |
| |
| #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_MEMBER_H_ |