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

Unified Diff: core/src/fxcodec/jbig2/JBig2_BitStream.h

Issue 1380243004: Various changes to JBig2 cache: (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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/fxcodec/jbig2/JBig2_BitStream.h
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h
index 85c992f4ff7a941311e247f254851fc022ab96c1..094867521e554326e78d4b187ae7b8caff0f152e 100644
--- a/core/src/fxcodec/jbig2/JBig2_BitStream.h
+++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h
@@ -7,11 +7,12 @@
#ifndef _JBIG2_BIT_STREAM_H_
#define _JBIG2_BIT_STREAM_H_
+#include "../../../include/fpdfapi/fpdf_objects.h"
#include "JBig2_Define.h"
class CJBig2_BitStream {
public:
- CJBig2_BitStream(const uint8_t* pBuffer, FX_DWORD dwLength);
+ CJBig2_BitStream(CPDF_StreamAcc* pSrcStream);
Lei Zhang 2015/10/06 22:40:24 add the explicit keyword
David Lattimore 2015/10/07 22:41:53 Done.
CJBig2_BitStream(CJBig2_BitStream& bs);
@@ -65,6 +66,8 @@ class CJBig2_BitStream {
FX_DWORD getByteLeft();
+ FX_DWORD getObjNum();
Lei Zhang 2015/10/06 22:40:24 This can be a const method.
David Lattimore 2015/10/07 22:41:53 Done.
+
private:
const uint8_t* m_pBuf;
@@ -73,11 +76,13 @@ class CJBig2_BitStream {
FX_DWORD m_dwByteIdx;
FX_DWORD m_dwBitIdx;
+
+ FX_DWORD m_dwObjNum;
Lei Zhang 2015/10/06 22:40:24 If you move the initialization in the ctors to the
David Lattimore 2015/10/07 22:41:53 Done.
};
-inline CJBig2_BitStream::CJBig2_BitStream(const uint8_t* pBuffer,
- FX_DWORD dwLength) {
- m_pBuf = pBuffer;
- m_dwLength = dwLength;
+inline CJBig2_BitStream::CJBig2_BitStream(CPDF_StreamAcc* pSrcStream) {
Lei Zhang 2015/10/06 22:40:24 Oh geez, I need to fix more of these silly inlinin
+ m_pBuf = pSrcStream->GetData();
+ m_dwLength = pSrcStream->GetSize();
+ m_dwObjNum = pSrcStream->GetStream()->GetObjNum();
m_dwByteIdx = 0;
m_dwBitIdx = 0;
if (m_dwLength > 256 * 1024 * 1024) {
@@ -90,6 +95,7 @@ inline CJBig2_BitStream::CJBig2_BitStream(CJBig2_BitStream& bs) {
m_dwLength = bs.m_dwLength;
m_dwByteIdx = bs.m_dwByteIdx;
m_dwBitIdx = bs.m_dwBitIdx;
+ m_dwObjNum = bs.m_dwObjNum;
}
inline CJBig2_BitStream::~CJBig2_BitStream() {}
inline int32_t CJBig2_BitStream::readNBits(FX_DWORD dwBits,
@@ -287,4 +293,7 @@ inline void CJBig2_BitStream::offset(FX_DWORD dwOffset) {
inline FX_DWORD CJBig2_BitStream::getByteLeft() {
return m_dwLength - m_dwByteIdx;
}
+inline FX_DWORD CJBig2_BitStream::getObjNum() {
+ return m_dwObjNum;
+}
#endif

Powered by Google App Engine
This is Rietveld 408576698