| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This fuzzer is simplified & cleaned up pdfium/samples/pdfium_test.cc | 5 // This fuzzer is simplified & cleaned up pdfium/samples/pdfium_test.cc |
| 6 | 6 |
| 7 #include "third_party/pdfium/public/fpdf_ext.h" | 7 #include "third_party/pdfium/public/fpdf_ext.h" |
| 8 #include "third_party/pdfium/public/fpdf_formfill.h" | 8 #include "third_party/pdfium/public/fpdf_formfill.h" |
| 9 #include "third_party/pdfium/public/fpdfview.h" | 9 #include "third_party/pdfium/public/fpdfview.h" |
| 10 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
| 11 | 11 |
| 12 class PDFiumFuzzerHelper { | 12 class PDFiumFuzzerHelper { |
| 13 public: | 13 public: |
| 14 virtual ~PDFiumFuzzerHelper(); | 14 virtual ~PDFiumFuzzerHelper(); |
| 15 | 15 |
| 16 void RenderPdf(const char* pBuf, size_t len); | 16 void RenderPdf(const char* pBuf, size_t len); |
| 17 | 17 |
| 18 virtual int GetFormCallbackVersion() const = 0; | 18 virtual int GetFormCallbackVersion() const = 0; |
| 19 virtual bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc); | 19 virtual bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc); |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 PDFiumFuzzerHelper(); | 22 PDFiumFuzzerHelper(); |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 bool RenderPage(const FPDF_DOCUMENT& doc, | 25 bool RenderPage(FPDF_DOCUMENT doc, |
| 26 const FPDF_FORMHANDLE& form, | 26 FPDF_FORMHANDLE form, |
| 27 const int page_index); | 27 const int page_index); |
| 28 }; | 28 }; |
| OLD | NEW |