| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ | 5 #ifndef PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ |
| 6 #define PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ | 6 #define PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 8 #include <stdlib.h> | 9 #include <stdlib.h> |
| 9 | 10 |
| 10 #include "third_party/pdfium/public/fpdfview.h" | 11 #include "third_party/pdfium/public/fpdfview.h" |
| 11 | 12 |
| 12 namespace chrome_pdf { | 13 namespace chrome_pdf { |
| 13 | 14 |
| 14 // Implementation of FPDF_FILEACCESS from a memory buffer. | 15 // Implementation of FPDF_FILEACCESS from a memory buffer. |
| 15 class PDFiumMemBufferFileRead : public FPDF_FILEACCESS { | 16 class PDFiumMemBufferFileRead : public FPDF_FILEACCESS { |
| 16 public: | 17 public: |
| 17 PDFiumMemBufferFileRead(const void* data, size_t size); | 18 PDFiumMemBufferFileRead(const void* data, size_t size); |
| 18 ~PDFiumMemBufferFileRead(); | 19 ~PDFiumMemBufferFileRead(); |
| 19 | 20 |
| 20 private: | 21 private: |
| 21 static int GetBlock(void* param, | 22 static int GetBlock(void* param, |
| 22 unsigned long position, | 23 unsigned long position, |
| 23 unsigned char* buf, | 24 unsigned char* buf, |
| 24 unsigned long size); | 25 unsigned long size); |
| 25 const unsigned char* data_; | 26 const unsigned char* data_; |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 } // namespace chrome_pdf | 29 } // namespace chrome_pdf |
| 29 | 30 |
| 30 #endif // PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ | 31 #endif // PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_ |
| OLD | NEW |