summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2/JBig2_BitStream.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-08 15:14:24 -0700
committerLei Zhang <thestig@chromium.org>2015-10-08 15:14:24 -0700
commit921cc2403a9e643dfb29d70564fa435a1d79f972 (patch)
tree005543a896eb07b52a416abc2bc681d286fc24db /core/src/fxcodec/jbig2/JBig2_BitStream.h
parentd1cb813d23df38a8e21df3314658995ded7c4b45 (diff)
downloadpdfium-921cc2403a9e643dfb29d70564fa435a1d79f972.tar.xz
Merge to XFA: Various changes to JBig2 cache:
- Makes the cache be per-document - Keys the cache on ObjNum and stream offset instead of keying on a pointer to the data (which can result in false cache hits). - Makes it so the cache is only used for the globals stream. - Reenable the cache. R=dml@google.com TBR=dml@google.com BUG=pdfium:207 Review URL: https://codereview.chromium.org/1380243004 . (cherry picked from commit f1b88e76134808f36f16b9e53a2e9dd89b12c8fd) Review URL: https://codereview.chromium.org/1394373002 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_BitStream.h')
-rw-r--r--core/src/fxcodec/jbig2/JBig2_BitStream.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h
index 9a3d8b0a18..c7c50b8c81 100644
--- a/core/src/fxcodec/jbig2/JBig2_BitStream.h
+++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h
@@ -9,9 +9,11 @@
#include "../../../include/fxcrt/fx_basic.h"
+class CPDF_StreamAcc;
+
class CJBig2_BitStream {
public:
- CJBig2_BitStream(const uint8_t* pBuffer, FX_DWORD dwLength);
+ explicit CJBig2_BitStream(CPDF_StreamAcc* pSrcStream);
~CJBig2_BitStream();
// TODO(thestig): readFoo() should return bool.
@@ -36,6 +38,7 @@ class CJBig2_BitStream {
const uint8_t* getPointer() const;
void offset(FX_DWORD dwOffset);
FX_DWORD getByteLeft() const;
+ FX_DWORD getObjNum() const;
private:
void AdvanceBit();
@@ -46,6 +49,7 @@ class CJBig2_BitStream {
FX_DWORD m_dwLength;
FX_DWORD m_dwByteIdx;
FX_DWORD m_dwBitIdx;
+ const FX_DWORD m_dwObjNum;
CJBig2_BitStream(const CJBig2_BitStream&) = delete;
void operator=(const CJBig2_BitStream&) = delete;