summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamparser.h')
-rw-r--r--core/fpdfapi/page/cpdf_streamparser.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_streamparser.h b/core/fpdfapi/page/cpdf_streamparser.h
index bdd07643ce..78727da481 100644
--- a/core/fpdfapi/page/cpdf_streamparser.h
+++ b/core/fpdfapi/page/cpdf_streamparser.h
@@ -16,14 +16,14 @@
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fxcrt/string_pool_template.h"
#include "core/fxcrt/weak_ptr.h"
+#include "third_party/base/span.h"
class CPDF_StreamParser {
public:
enum SyntaxType { EndOfData, Number, Keyword, Name, Others };
- CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize);
- CPDF_StreamParser(const uint8_t* pData,
- uint32_t dwSize,
+ explicit CPDF_StreamParser(pdfium::span<const uint8_t> span);
+ CPDF_StreamParser(pdfium::span<const uint8_t> span,
const WeakPtr<ByteStringPool>& pPool);
~CPDF_StreamParser();
@@ -51,12 +51,11 @@ class CPDF_StreamParser {
ByteString ReadHexString();
bool PositionIsInBounds() const;
- uint32_t m_Size; // Length in bytes of m_pBuf.
- uint32_t m_Pos; // Current byte position within m_pBuf.
- uint32_t m_WordSize; // Current byte position within m_WordBuffer.
- const uint8_t* m_pBuf;
- std::unique_ptr<CPDF_Object> m_pLastObj;
+ uint32_t m_Pos = 0; // Current byte position within m_pBuf.
+ uint32_t m_WordSize = 0; // Current byte position within m_WordBuffer.
WeakPtr<ByteStringPool> m_pPool;
+ std::unique_ptr<CPDF_Object> m_pLastObj;
+ pdfium::span<const uint8_t> m_pBuf;
uint8_t m_WordBuffer[kMaxWordLength + 1]; // Include space for NUL.
};