diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2017-10-03 17:33:19 +0300 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-03 19:53:25 +0000 |
commit | aafdc153a2b7609968b315ca6c6900717f6d6c36 (patch) | |
tree | 4e9671595b04047a507a64292f19114d9589be91 /core/fpdfapi/parser/cpdf_hint_tables.cpp | |
parent | 609d1fd4a4360e2592c5c59d60758ac67a1cb4ee (diff) | |
download | pdfium-aafdc153a2b7609968b315ca6c6900717f6d6c36.tar.xz |
Unify CPDF_HintsTable.chromium/3232
Break relationship from CPDF_DataAvail for CPDF_HintsTable.
Change-Id: If3e6d4910dd368742f095c05adb122ab08c0d804
Reviewed-on: https://pdfium-review.googlesource.com/15270
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_hint_tables.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_hint_tables.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_hint_tables.cpp b/core/fpdfapi/parser/cpdf_hint_tables.cpp index 7a5eb2397b..e88da2eea8 100644 --- a/core/fpdfapi/parser/cpdf_hint_tables.cpp +++ b/core/fpdfapi/parser/cpdf_hint_tables.cpp @@ -13,6 +13,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_linearized_header.h" +#include "core/fpdfapi/parser/cpdf_read_validator.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcrt/cfx_bitstream.h" @@ -35,9 +36,9 @@ bool IsValidPageOffsetHintTableBitCount(uint32_t bits) { } // namespace -CPDF_HintTables::CPDF_HintTables(CPDF_DataAvail* pDataAvail, +CPDF_HintTables::CPDF_HintTables(CPDF_ReadValidator* pValidator, CPDF_LinearizedHeader* pLinearized) - : m_pDataAvail(pDataAvail), + : m_pValidator(pValidator), m_pLinearized(pLinearized), m_nFirstPageSharedObjs(0), m_szFirstPageObjOffset(0) { @@ -413,7 +414,8 @@ CPDF_DataAvail::DocAvailStatus CPDF_HintTables::CheckPage(uint32_t index) { if (!dwLength) return CPDF_DataAvail::DataError; - if (!m_pDataAvail->IsDataAvail(m_szPageOffsetArray[index], dwLength)) + if (!m_pValidator->CheckDataRangeAndRequestIfUnavailable( + m_szPageOffsetArray[index], dwLength)) return CPDF_DataAvail::DataNotAvailable; // Download data of shared objects in the page. @@ -444,8 +446,8 @@ CPDF_DataAvail::DocAvailStatus CPDF_HintTables::CheckPage(uint32_t index) { if (!dwLength) return CPDF_DataAvail::DataError; - if (!m_pDataAvail->IsDataAvail(m_szSharedObjOffsetArray[dwIndex], - dwLength)) { + if (!m_pValidator->CheckDataRangeAndRequestIfUnavailable( + m_szSharedObjOffsetArray[dwIndex], dwLength)) { return CPDF_DataAvail::DataNotAvailable; } } |