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

Unified Diff: core/src/fpdfapi/fpdf_parser/parser_int.h

Issue 1353093003: Support linearized loading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_parser/parser_int.h
diff --git a/core/src/fpdfapi/fpdf_parser/parser_int.h b/core/src/fpdfapi/fpdf_parser/parser_int.h
new file mode 100644
index 0000000000000000000000000000000000000000..b23286ce731a86445437504e3c137fdca8708f19
--- /dev/null
+++ b/core/src/fpdfapi/fpdf_parser/parser_int.h
@@ -0,0 +1,49 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2015 Foxit Software Inc. http://www.foxitsoftware.com
Tom Sepez 2015/09/22 19:17:59 Nah, no need to update this every time the year ch
Lei Zhang 2015/09/22 23:33:43 Well, if FoxIt is writing this code in 2015... Al
jun_fang 2015/09/23 12:26:58 OK. will keep 2014 here.
+
+#ifndef _FPDFAPI_PARSER_INT_H_
Lei Zhang 2015/09/22 23:33:43 CORE_SRC_FPDFAPI_FPDF_PARSER_PARSER_INT_H_
jun_fang 2015/09/23 12:26:58 Acknowledged.
+#define _FPDFAPI_PARSER_INT_H_
+
+class CPDF_DataAvail;
+
+class CPDF_HintTables {
+ public:
+ CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized)
+ : m_pLinearizedDict(pLinearized),
+ m_pHintStream(nullptr),
+ m_pDataAvail(pDataAvail),
+ m_nFirstPageSharedObjs(0),
+ m_szFirstPageObjOffset(0) {}
+ ~CPDF_HintTables();
+ FX_BOOL GetPagePos(int index,
+ FX_FILESIZE& szPageStartPos,
+ FX_FILESIZE& szPageLength,
+ FX_DWORD& dwObjNum);
+ FX_BOOL CheckPage(int index, IFX_DownloadHints* pHints);
+ FX_BOOL LoadHintStream(CPDF_Stream* pHintStream);
+
+ protected:
+ FX_BOOL ReadPageHintTable(CFX_BitStream& bs);
+ FX_BOOL ReadSharedObjHintTable(CFX_BitStream& bs);
+ FX_DWORD GetItemLength(int index, const CFX_FileSizeArray& szArray);
+
+ private:
+ int ReadPrimaryHintStreamOffset(CFX_BitStream& bs) const;
+ int ReadPrimaryHintStreamLength(CFX_BitStream& bs) const;
+
+ CPDF_Dictionary* m_pLinearizedDict;
+ CPDF_Stream* m_pHintStream;
+ CPDF_DataAvail* m_pDataAvail;
+ FX_DWORD m_nFirstPageSharedObjs;
+ FX_FILESIZE m_szFirstPageObjOffset;
+ CFX_DWordArray m_dwDeltaNObjsArray;
+ CFX_DWordArray m_dwNSharedObjsArray;
+ CFX_DWordArray m_dwSharedObjNumArray;
+ CFX_DWordArray m_dwIdentifierArray;
+ CFX_FileSizeArray m_szPageOffsetArray;
+ CFX_FileSizeArray m_szSharedObjOffsetArray;
+};
+#endif //_FPDFAPI_PARSER_INT_H_

Powered by Google App Engine
This is Rietveld 408576698