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

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

Issue 1380243004: Various changes to JBig2 cache: (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Addressed comment 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
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/src/fxcodec/jbig2/JBig2_Context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_BitStream.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.cpp b/core/src/fxcodec/jbig2/JBig2_BitStream.cpp
index 4a4ed992c7fe387045546d7f4be81b8cd1e699f2..f39a396e714a7b3c36fc9f9c78834f8384f45f73 100644
--- a/core/src/fxcodec/jbig2/JBig2_BitStream.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_BitStream.cpp
@@ -4,12 +4,18 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "../../../include/fpdfapi/fpdf_objects.h"
#include "JBig2_BitStream.h"
#include <algorithm>
-CJBig2_BitStream::CJBig2_BitStream(const uint8_t* pBuffer, FX_DWORD dwLength)
- : m_pBuf(pBuffer), m_dwLength(dwLength), m_dwByteIdx(0), m_dwBitIdx(0) {
+CJBig2_BitStream::CJBig2_BitStream(CPDF_StreamAcc* pSrcStream)
+ : m_pBuf(pSrcStream->GetData()),
+ m_dwLength(pSrcStream->GetSize()),
+ m_dwByteIdx(0),
+ m_dwBitIdx(0),
+ m_dwObjNum(pSrcStream->GetStream() ? pSrcStream->GetStream()->GetObjNum()
+ : 0) {
if (m_dwLength > 256 * 1024 * 1024) {
m_dwLength = 0;
m_pBuf = nullptr;
@@ -176,3 +182,7 @@ bool CJBig2_BitStream::IsInBound() const {
FX_DWORD CJBig2_BitStream::LengthInBits() const {
return m_dwLength << 3;
}
+
+FX_DWORD CJBig2_BitStream::getObjNum() const {
+ return m_dwObjNum;
+}
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/src/fxcodec/jbig2/JBig2_Context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698