Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: fpdfsdk/include/fsdk_define.h

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: remove .tmp files Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ 7 #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_
8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ 8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_
9 9
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
(...skipping 15 matching lines...) Expand all
26 class IFSDK_PAUSE_Adapter; 26 class IFSDK_PAUSE_Adapter;
27 27
28 class CPDF_CustomAccess final : public IFX_FileRead { 28 class CPDF_CustomAccess final : public IFX_FileRead {
29 public: 29 public:
30 explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); 30 explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess);
31 ~CPDF_CustomAccess() override {} 31 ~CPDF_CustomAccess() override {}
32 32
33 // IFX_FileRead 33 // IFX_FileRead
34 FX_FILESIZE GetSize() override; 34 FX_FILESIZE GetSize() override;
35 void Release() override; 35 void Release() override;
36 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; 36 FX_BOOL IsEOF() override;
37 size_t ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
37 38
38 #ifdef PDF_ENABLE_XFA 39 #ifdef PDF_ENABLE_XFA
39 virtual CFX_ByteString GetFullPath(); 40 virtual CFX_ByteString GetFullPath();
40 virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch); 41 virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch);
41 virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size); 42 virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size);
42 #endif // PDF_ENABLE_XFA 43 #endif // PDF_ENABLE_XFA
43 44
44 private: 45 private:
45 FPDF_FILEACCESS m_FileAccess; 46 FPDF_FILEACCESS m_FileAccess;
47 FX_FILESIZE m_nCurPos;
46 #ifdef PDF_ENABLE_XFA 48 #ifdef PDF_ENABLE_XFA
47 uint8_t m_Buffer[512]; 49 uint8_t m_Buffer[512];
48 uint32_t m_BufferOffset; 50 uint32_t m_BufferOffset;
49 #endif // PDF_ENABLE_XFA 51 #endif // PDF_ENABLE_XFA
50 }; 52 };
51 53
52 #ifdef PDF_ENABLE_XFA 54 #ifdef PDF_ENABLE_XFA
53 class CFPDF_FileStream : public IFX_FileStream { 55 class CFPDF_FileStream : public IFX_FileStream {
54 public: 56 public:
55 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); 57 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS);
56 ~CFPDF_FileStream() override {} 58 ~CFPDF_FileStream() override {}
57 59
58 // IFX_FileStream: 60 // IFX_FileStream:
59 IFX_FileStream* Retain() override; 61 IFX_FileStream* Retain() override;
60 void Release() override; 62 void Release() override;
61 FX_FILESIZE GetSize() override; 63 FX_FILESIZE GetSize() override;
62 FX_BOOL IsEOF() override; 64 FX_BOOL IsEOF() override;
63 FX_FILESIZE GetPosition() override; 65 FX_FILESIZE GetPosition() override;
64 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; 66 size_t ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
65 size_t ReadBlock(void* buffer, size_t size) override; 67 size_t ReadBlock(void* buffer, size_t size) override;
66 FX_BOOL WriteBlock(const void* buffer, 68 FX_BOOL WriteBlock(const void* buffer,
67 FX_FILESIZE offset, 69 FX_FILESIZE offset,
68 size_t size) override; 70 size_t size) override;
69 FX_BOOL Flush() override; 71 FX_BOOL Flush() override;
70 72
71 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } 73 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; }
72 74
73 protected: 75 protected:
74 FPDF_FILEHANDLER* m_pFS; 76 FPDF_FILEHANDLER* m_pFS;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 int rotate, 114 int rotate,
113 int flags, 115 int flags,
114 FX_BOOL bNeedToRestore, 116 FX_BOOL bNeedToRestore,
115 IFSDK_PAUSE_Adapter* pause); 117 IFSDK_PAUSE_Adapter* pause);
116 118
117 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); 119 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code);
118 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); 120 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot);
119 void ProcessParseError(CPDF_Parser::Error err); 121 void ProcessParseError(CPDF_Parser::Error err);
120 122
121 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ 123 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698