summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-19 23:26:24 -0800
committerLei Zhang <thestig@chromium.org>2015-11-19 23:26:24 -0800
commitaa28c814795edfdeb0654f16e77a54f65b7d42c2 (patch)
treebe94256c75a192375e5e41bbfc41dcf074a37e72 /core/include
parent5fd907b8266766152377a9836abfcac0161832fc (diff)
downloadpdfium-aa28c814795edfdeb0654f16e77a54f65b7d42c2.tar.xz
Merge to XFA: Cache object numbers in CPDF_Parser::ParseIndirectObject().
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1458633004 . (cherry picked from commit 0c8e6c1f39f20985a3efb17292e46c476194183a) Review URL: https://codereview.chromium.org/1461693005 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 1ce43532f3..a9e79ae9e2 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -7,6 +7,8 @@
#ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
#define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
+#include <map>
+
#include "core/include/fxcrt/fx_system.h"
#include "fpdf_objects.h"
#include "public/fpdf_dataavail.h"
@@ -499,8 +501,6 @@ class CPDF_Parser {
FX_DWORD LoadLinearizedMainXRefTable();
- CFX_MapPtrToPtr m_ObjectStreamMap;
-
CPDF_StreamAcc* GetObjectStream(FX_DWORD number);
FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
@@ -544,9 +544,22 @@ class CPDF_Parser {
FX_DWORD m_dwFirstPageNo;
FX_DWORD m_dwXrefStartObjNum;
+
+ // A map of object numbers to indirect streams. Map owns the streams.
+ CFX_MapPtrToPtr m_ObjectStreamMap;
+
+ // Mapping of object numbers to offsets. The offsets are relative to the first
+ // object in the stream.
+ using StreamObjectCache = std::map<FX_DWORD, FX_DWORD>;
+
+ // Mapping of streams to their object caches. This is valid as long as the
+ // streams in |m_ObjectStreamMap| are valid.
+ std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache;
+
friend class CPDF_Creator;
friend class CPDF_DataAvail;
};
+
#define FXCIPHER_NONE 0
#define FXCIPHER_RC4 1
#define FXCIPHER_AES 2