1 // Copyright 2017 The Chromium 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 TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_ 6 #define TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_ 7 8 #include <stdint.h> 9 10 #include "public/fpdfview.h" 11 12 class PDFiumFuzzerHelper { 13 public: 14 void RenderPdf(const char* data, size_t len); 15 16 virtual int GetFormCallbackVersion() const = 0; 17 virtual bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc); OnRenderFinished(FPDF_DOCUMENT doc)18 virtual void OnRenderFinished(FPDF_DOCUMENT doc) {} 19 20 protected: 21 PDFiumFuzzerHelper(); 22 virtual ~PDFiumFuzzerHelper(); 23 24 private: 25 bool RenderPage(FPDF_DOCUMENT doc, 26 FPDF_FORMHANDLE form, 27 int page_index, 28 int render_flags, 29 int form_flags); 30 }; 31 32 #endif // TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_ 33