v8  8.4.371 (node 14.15.5)
V8 is Google's open source JavaScript engine
prefinalizer-handler.h
Go to the documentation of this file.
1 // Copyright 2020 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
6 #define INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
7 
8 #include "cppgc/heap.h"
9 #include "cppgc/liveness-broker.h"
10 
11 namespace cppgc {
12 namespace internal {
13 
14 class V8_EXPORT PreFinalizerRegistrationDispatcher final {
15  public:
16  using PreFinalizerCallback = bool (*)(const LivenessBroker&, void*);
17  struct PreFinalizer {
18  void* object_;
19  PreFinalizerCallback callback_;
20 
21  bool operator==(const PreFinalizer& other);
22  };
23 
24  static void RegisterPrefinalizer(cppgc::Heap* heap,
25  PreFinalizer prefinalzier);
26 };
27 
28 } // namespace internal
29 } // namespace cppgc
30 
31 #endif // INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_