xref: /aosp_15_r20/external/pdfium/testing/fuzzers/xfa_process_state.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2020 The PDFium Authors
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 TESTING_FUZZERS_XFA_PROCESS_STATE_H_
6 #define TESTING_FUZZERS_XFA_PROCESS_STATE_H_
7 
8 #if !defined(PDF_ENABLE_XFA)
9 #error "XFA only"
10 #endif
11 
12 #include "fxjs/gc/heap.h"
13 
14 namespace v8 {
15 class Isolate;
16 class Platform;
17 }  // namespace v8
18 
19 class XFAProcessState {
20  public:
21   XFAProcessState(v8::Platform* platform, v8::Isolate* isolate);
22   ~XFAProcessState();
23 
24   cppgc::Heap* GetHeap() const;
25   void ForceGCAndPump();
26 
27  private:
28   v8::Platform* const platform_;
29   v8::Isolate* const isolate_;
30   FXGCScopedHeap heap_;
31 };
32 
33 #endif  // TESTING_FUZZERS_XFA_PROCESS_STATE_H_
34