summaryrefslogtreecommitdiff
path: root/testing/fuzzers/pdfium_fuzzer_helper.h
blob: f9db00fa64a5aafe5dabbdca0ef7dbcbb75d8be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2017 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 TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_
#define TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_

#include "public/fpdfview.h"

class PDFiumFuzzerHelper {
 public:
  void RenderPdf(const char* pBuf, size_t len);

  virtual int GetFormCallbackVersion() const = 0;
  virtual bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc);

 protected:
  PDFiumFuzzerHelper();
  virtual ~PDFiumFuzzerHelper();

 private:
  bool RenderPage(FPDF_DOCUMENT doc, FPDF_FORMHANDLE form, int page_index);
};

#endif  // TESTING_FUZZERS_PDFIUM_FUZZER_HELPER_H_