| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_data_avail.h" |
| 13 #include "core/fxcrt/include/fx_basic.h" | 13 #include "core/fxcrt/include/fx_basic.h" |
| 14 #include "core/fxcrt/include/fx_stream.h" | 14 #include "core/fxcrt/include/fx_stream.h" |
| 15 | 15 |
| 16 class CFX_BitStream; | 16 class CFX_BitStream; |
| 17 class CPDF_DataAvail; | |
| 18 class CPDF_Dictionary; | 17 class CPDF_Dictionary; |
| 19 class CPDF_Stream; | 18 class CPDF_Stream; |
| 20 | 19 |
| 21 class CPDF_HintTables { | 20 class CPDF_HintTables { |
| 22 public: | 21 public: |
| 23 CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized); | 22 CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized); |
| 24 ~CPDF_HintTables(); | 23 ~CPDF_HintTables(); |
| 25 | 24 |
| 26 FX_BOOL GetPagePos(int index, | 25 FX_BOOL GetPagePos(int index, |
| 27 FX_FILESIZE& szPageStartPos, | 26 FX_FILESIZE& szPageStartPos, |
| 28 FX_FILESIZE& szPageLength, | 27 FX_FILESIZE& szPageLength, |
| 29 uint32_t& dwObjNum); | 28 uint32_t& dwObjNum); |
| 30 | 29 |
| 31 IPDF_DataAvail::DocAvailStatus CheckPage( | 30 CPDF_DataAvail::DocAvailStatus CheckPage( |
| 32 int index, | 31 int index, |
| 33 IPDF_DataAvail::DownloadHints* pHints); | 32 CPDF_DataAvail::DownloadHints* pHints); |
| 34 | 33 |
| 35 FX_BOOL LoadHintStream(CPDF_Stream* pHintStream); | 34 FX_BOOL LoadHintStream(CPDF_Stream* pHintStream); |
| 36 | 35 |
| 37 protected: | 36 protected: |
| 38 FX_BOOL ReadPageHintTable(CFX_BitStream* hStream); | 37 FX_BOOL ReadPageHintTable(CFX_BitStream* hStream); |
| 39 FX_BOOL ReadSharedObjHintTable(CFX_BitStream* hStream, uint32_t offset); | 38 FX_BOOL ReadSharedObjHintTable(CFX_BitStream* hStream, uint32_t offset); |
| 40 uint32_t GetItemLength(int index, const std::vector<FX_FILESIZE>& szArray); | 39 uint32_t GetItemLength(int index, const std::vector<FX_FILESIZE>& szArray); |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 int ReadPrimaryHintStreamOffset() const; | 42 int ReadPrimaryHintStreamOffset() const; |
| 44 int ReadPrimaryHintStreamLength() const; | 43 int ReadPrimaryHintStreamLength() const; |
| 45 | 44 |
| 46 // Owner, outlives this object. | 45 // Owner, outlives this object. |
| 47 CPDF_DataAvail* const m_pDataAvail; | 46 CPDF_DataAvail* const m_pDataAvail; |
| 48 | 47 |
| 49 // Owned by |m_pDataAvail|. | 48 // Owned by |m_pDataAvail|. |
| 50 CPDF_Dictionary* const m_pLinearizedDict; | 49 CPDF_Dictionary* const m_pLinearizedDict; |
| 51 | 50 |
| 52 uint32_t m_nFirstPageSharedObjs; | 51 uint32_t m_nFirstPageSharedObjs; |
| 53 FX_FILESIZE m_szFirstPageObjOffset; | 52 FX_FILESIZE m_szFirstPageObjOffset; |
| 54 CFX_ArrayTemplate<uint32_t> m_dwDeltaNObjsArray; | 53 CFX_ArrayTemplate<uint32_t> m_dwDeltaNObjsArray; |
| 55 CFX_ArrayTemplate<uint32_t> m_dwNSharedObjsArray; | 54 CFX_ArrayTemplate<uint32_t> m_dwNSharedObjsArray; |
| 56 CFX_ArrayTemplate<uint32_t> m_dwSharedObjNumArray; | 55 CFX_ArrayTemplate<uint32_t> m_dwSharedObjNumArray; |
| 57 CFX_ArrayTemplate<uint32_t> m_dwIdentifierArray; | 56 CFX_ArrayTemplate<uint32_t> m_dwIdentifierArray; |
| 58 std::vector<FX_FILESIZE> m_szPageOffsetArray; | 57 std::vector<FX_FILESIZE> m_szPageOffsetArray; |
| 59 std::vector<FX_FILESIZE> m_szSharedObjOffsetArray; | 58 std::vector<FX_FILESIZE> m_szSharedObjOffsetArray; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ | 61 #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_HINT_TABLES_H_ |
| OLD | NEW |