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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_hint_tables.h

Issue 2241153002: Clean up CPDF_HintTables. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 4 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/fpdfapi/fpdf_parser/cpdf_hint_tables.h
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
index 1eb072367accd21cf8146985f85d6c75e16db290..35fbdcb79bfd2f0dac189689e6e87d3948a65703 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
@@ -22,26 +22,33 @@ class CPDF_HintTables {
CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized);
~CPDF_HintTables();
- FX_BOOL GetPagePos(int index,
- FX_FILESIZE& szPageStartPos,
- FX_FILESIZE& szPageLength,
- uint32_t& dwObjNum);
+ bool GetPagePos(int index,
+ FX_FILESIZE* szPageStartPos,
+ FX_FILESIZE* szPageLength,
+ uint32_t* dwObjNum);
CPDF_DataAvail::DocAvailStatus CheckPage(
int index,
CPDF_DataAvail::DownloadHints* pHints);
- FX_BOOL LoadHintStream(CPDF_Stream* pHintStream);
+ bool LoadHintStream(CPDF_Stream* pHintStream);
protected:
- FX_BOOL ReadPageHintTable(CFX_BitStream* hStream);
- FX_BOOL ReadSharedObjHintTable(CFX_BitStream* hStream, uint32_t offset);
+ bool ReadPageHintTable(CFX_BitStream* hStream);
+ bool ReadSharedObjHintTable(CFX_BitStream* hStream, uint32_t offset);
uint32_t GetItemLength(int index, const std::vector<FX_FILESIZE>& szArray);
private:
+ int GetEndOfFirstPageOffset() const;
+ int GetNumberOfPages() const;
+ int GetFirstPageObjectNumber() const;
+ int GetFirstPageNumber() const;
int ReadPrimaryHintStreamOffset() const;
int ReadPrimaryHintStreamLength() const;
+ // Helper for the ReadPrimaryHintStream methods above.
+ int ReadPrimaryHintStream(int index) const;
+
// Owner, outlives this object.
CPDF_DataAvail* const m_pDataAvail;
@@ -50,10 +57,10 @@ class CPDF_HintTables {
uint32_t m_nFirstPageSharedObjs;
FX_FILESIZE m_szFirstPageObjOffset;
- CFX_ArrayTemplate<uint32_t> m_dwDeltaNObjsArray;
- CFX_ArrayTemplate<uint32_t> m_dwNSharedObjsArray;
- CFX_ArrayTemplate<uint32_t> m_dwSharedObjNumArray;
- CFX_ArrayTemplate<uint32_t> m_dwIdentifierArray;
+ std::vector<uint32_t> m_dwDeltaNObjsArray;
+ std::vector<uint32_t> m_dwNSharedObjsArray;
+ std::vector<uint32_t> m_dwSharedObjNumArray;
+ std::vector<uint32_t> m_dwIdentifierArray;
std::vector<FX_FILESIZE> m_szPageOffsetArray;
std::vector<FX_FILESIZE> m_szSharedObjOffsetArray;
};

Powered by Google App Engine
This is Rietveld 408576698