| // Copyright 2020 The PDFium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef TESTING_FUZZERS_PDF_FUZZER_INIT_PUBLIC_H_ |
| #define TESTING_FUZZERS_PDF_FUZZER_INIT_PUBLIC_H_ |
| #include "public/fpdf_ext.h" |
| #include "public/fpdfview.h" |
| #include "v8/include/v8-array-buffer.h" |
| #include "v8/include/v8-snapshot.h" |
| // Initializes the library once for all runs of the fuzzer. |
| class PDFFuzzerInitPublic { |
| FPDF_LIBRARY_CONFIG config_; |
| UNSUPPORT_INFO unsupport_info_; |
| #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| v8::StartupData snapshot_blob_; |
| #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| std::unique_ptr<v8::Platform> platform_; |
| std::unique_ptr<v8::ArrayBuffer::Allocator> allocator_; |
| std::unique_ptr<v8::Isolate, CFX_V8IsolateDeleter> isolate_; |
| std::unique_ptr<XFAProcessState> xfa_process_state_; |
| #endif // TESTING_FUZZERS_PDF_FUZZER_INIT_PUBLIC_H_ |