Chromium Code Reviews| Index: core/include/fpdfapi/fpdf_parser.h |
| diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h |
| index de0aa6196c8a533edb5097782140cec66e62aa7d..6e67aac5e08553628c4e1f51652a408bd104197b 100644 |
| --- a/core/include/fpdfapi/fpdf_parser.h |
| +++ b/core/include/fpdfapi/fpdf_parser.h |
| @@ -394,10 +394,6 @@ class CPDF_Parser { |
| CFX_ByteString GetPassword() { return m_Password; } |
| - CPDF_SecurityHandler* GetSecurityHandler() { |
|
Lei Zhang
2015/12/18 01:36:04
Some dead code here.
|
| - return m_pSecurityHandler.get(); |
| - } |
| - |
| CPDF_CryptoHandler* GetCryptoHandler() { |
| return m_Syntax.m_pCryptoHandler.get(); |
| } |
| @@ -405,44 +401,32 @@ class CPDF_Parser { |
| void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, |
| FX_BOOL bForced = FALSE); |
| - CFX_ByteString GetRecipient() { return m_bsRecipient; } |
| - |
| CPDF_Dictionary* GetTrailer() { return m_pTrailer; } |
| FX_FILESIZE GetLastXRefOffset() { return m_LastXRefOffset; } |
| CPDF_Document* GetDocument() { return m_pDocument; } |
| - CFX_ArrayTemplate<CPDF_Dictionary*>* GetOtherTrailers() { |
| - return &m_Trailers; |
| - } |
| - |
| FX_DWORD GetRootObjNum(); |
| FX_DWORD GetInfoObjNum(); |
| CPDF_Array* GetIDArray(); |
| CPDF_Dictionary* GetEncryptDict() { return m_pEncryptDict; } |
| - FX_BOOL IsEncrypted() { return GetEncryptDict() != NULL; } |
| - |
| CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, |
| FX_DWORD objnum, |
| PARSE_CONTEXT* pContext = NULL); |
| - FX_DWORD GetLastObjNum(); |
| + void SetLastObjNum(FX_DWORD num); |
|
Wei Li
2015/12/18 19:20:34
I think this may not be needed. The intent of call
Lei Zhang
2015/12/19 02:09:52
Done. I think that works because all the callers a
|
| + FX_DWORD GetLastObjNum() const; |
|
Wei Li
2015/12/18 19:20:34
To get the largest obj number in pdf, it can direc
Lei Zhang
2015/12/19 02:09:52
But if the map is empty, there's no last key. Thus
|
| + FX_DWORD GetSize() const; |
|
Wei Li
2015/12/18 19:20:34
Similarly, GetSize for a parser could be ambiguous
Lei Zhang
2015/12/19 02:09:52
I replaced it with IsValidObjectNumber().
|
| FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm); |
| FX_FILESIZE GetObjectOffset(FX_DWORD objnum); |
| FX_FILESIZE GetObjectSize(FX_DWORD objnum); |
| - int GetObjectVersion(FX_DWORD objnum) { return m_ObjVersion[objnum]; } |
| - |
| void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); |
| - FX_BOOL GetFileStreamOption() { return m_Syntax.m_bFileStream; } |
| - |
| - void SetFileStreamOption(FX_BOOL b) { m_Syntax.m_bFileStream = b; } |
| - |
| IFX_FileRead* GetFileAccess() const { return m_Syntax.m_pFileAccess; } |
| int GetFileVersion() const { return m_FileVersion; } |
| @@ -523,13 +507,24 @@ class CPDF_Parser { |
| CFX_ByteString m_Password; |
| - CFX_FileSizeArray m_CrossRef; |
| + struct ObjectInfo { |
| + ObjectInfo() : pos(0) {} |
| + |
| + FX_FILESIZE pos; |
| +// TODO(thestig): Use fields below in place of |m_V5Type| and |m_ObjVersion| |
| +#if 0 |
| + uint8_t type; |
| + uint16_t gennum; |
| +#endif |
| + }; |
| + std::map<FX_DWORD, ObjectInfo> m_ObjectInfo; |
| + FX_DWORD m_dwLastObjnum; |
| CFX_ByteArray m_V5Type; |
| + CFX_WordArray m_ObjVersion; |
| CFX_FileSizeArray m_SortedOffset; |
| - CFX_WordArray m_ObjVersion; |
| CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers; |
| FX_BOOL m_bVersionUpdated; |