diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-04 14:37:18 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-04 21:48:48 +0000 |
commit | afd0d1f488ea55da545b3310fd8f22e45522a695 (patch) | |
tree | 89136eba4669421b6f828edb9f3d69ee558110d0 /core/fpdfapi/parser/cpdf_parser.h | |
parent | 4f8b044b95dc282959dfe41453e2a9c1ec7e9354 (diff) | |
download | pdfium-afd0d1f488ea55da545b3310fd8f22e45522a695.tar.xz |
RefCount CPDF_StreamAcc all the time.
Pass stream argument to constructor; it feels like a
stream accessor should always be made from a stream rather
than passing one in after the fact.
Change-Id: Iaa46cb37677b81f0170f5d39bab76ad38ea4af44
Reviewed-on: https://pdfium-review.googlesource.com/3620
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index 0b73857649..47c2c9b885 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -140,7 +140,7 @@ class CPDF_Parser { bool LoadLinearizedCrossRefV4(FX_FILESIZE pos, uint32_t dwObjCount); bool LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); Error LoadLinearizedMainXRefTable(); - CPDF_StreamAcc* GetObjectStream(uint32_t number); + CFX_RetainPtr<CPDF_StreamAcc> GetObjectStream(uint32_t number); bool IsLinearizedFile( const CFX_RetainPtr<IFX_SeekableReadStream>& pFileAccess, uint32_t offset); @@ -165,8 +165,8 @@ class CPDF_Parser { std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized; uint32_t m_dwXrefStartObjNum; - // A map of object numbers to indirect streams. Map owns the streams. - std::map<uint32_t, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap; + // A map of object numbers to indirect streams. + std::map<uint32_t, CFX_RetainPtr<CPDF_StreamAcc>> m_ObjectStreamMap; // Mapping of object numbers to offsets. The offsets are relative to the first // object in the stream. @@ -174,7 +174,7 @@ class CPDF_Parser { // 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; + std::map<CFX_RetainPtr<CPDF_StreamAcc>, StreamObjectCache> m_ObjCache; // All indirect object numbers that are being parsed. std::set<uint32_t> m_ParsingObjNums; |