OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
9 | 9 |
| 10 #include <map> |
| 11 |
10 #include "core/include/fxcrt/fx_system.h" | 12 #include "core/include/fxcrt/fx_system.h" |
11 #include "fpdf_objects.h" | 13 #include "fpdf_objects.h" |
12 #include "public/fpdf_dataavail.h" | 14 #include "public/fpdf_dataavail.h" |
13 #include "third_party/base/nonstd_unique_ptr.h" | 15 #include "third_party/base/nonstd_unique_ptr.h" |
14 | 16 |
15 class CFDF_Document; | 17 class CFDF_Document; |
16 class CFDF_Parser; | 18 class CFDF_Parser; |
17 class CFX_AffineMatrix; | 19 class CFX_AffineMatrix; |
18 class CFX_DIBSource; | 20 class CFX_DIBSource; |
19 class CFX_FloatRect; | 21 class CFX_FloatRect; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 void ReleaseEncryptHandler(); | 494 void ReleaseEncryptHandler(); |
493 | 495 |
494 FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); | 496 FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); |
495 | 497 |
496 FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); | 498 FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); |
497 | 499 |
498 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); | 500 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); |
499 | 501 |
500 FX_DWORD LoadLinearizedMainXRefTable(); | 502 FX_DWORD LoadLinearizedMainXRefTable(); |
501 | 503 |
502 CFX_MapPtrToPtr m_ObjectStreamMap; | |
503 | |
504 CPDF_StreamAcc* GetObjectStream(FX_DWORD number); | 504 CPDF_StreamAcc* GetObjectStream(FX_DWORD number); |
505 | 505 |
506 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); | 506 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); |
507 | 507 |
508 bool FindPosInOffsets(FX_FILESIZE pos) const; | 508 bool FindPosInOffsets(FX_FILESIZE pos) const; |
509 | 509 |
510 int m_FileVersion; | 510 int m_FileVersion; |
511 | 511 |
512 CPDF_Dictionary* m_pTrailer; | 512 CPDF_Dictionary* m_pTrailer; |
513 | 513 |
(...skipping 23 matching lines...) Expand all Loading... |
537 CFX_WordArray m_ObjVersion; | 537 CFX_WordArray m_ObjVersion; |
538 CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers; | 538 CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers; |
539 | 539 |
540 FX_BOOL m_bVersionUpdated; | 540 FX_BOOL m_bVersionUpdated; |
541 | 541 |
542 CPDF_Object* m_pLinearized; | 542 CPDF_Object* m_pLinearized; |
543 | 543 |
544 FX_DWORD m_dwFirstPageNo; | 544 FX_DWORD m_dwFirstPageNo; |
545 | 545 |
546 FX_DWORD m_dwXrefStartObjNum; | 546 FX_DWORD m_dwXrefStartObjNum; |
| 547 |
| 548 // A map of object numbers to indirect streams. Map owns the streams. |
| 549 CFX_MapPtrToPtr m_ObjectStreamMap; |
| 550 |
| 551 // Mapping of object numbers to offsets. The offsets are relative to the first |
| 552 // object in the stream. |
| 553 using StreamObjectCache = std::map<FX_DWORD, FX_DWORD>; |
| 554 |
| 555 // Mapping of streams to their object caches. This is valid as long as the |
| 556 // streams in |m_ObjectStreamMap| are valid. |
| 557 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; |
| 558 |
547 friend class CPDF_Creator; | 559 friend class CPDF_Creator; |
548 friend class CPDF_DataAvail; | 560 friend class CPDF_DataAvail; |
549 }; | 561 }; |
| 562 |
550 #define FXCIPHER_NONE 0 | 563 #define FXCIPHER_NONE 0 |
551 #define FXCIPHER_RC4 1 | 564 #define FXCIPHER_RC4 1 |
552 #define FXCIPHER_AES 2 | 565 #define FXCIPHER_AES 2 |
553 #define FXCIPHER_AES2 3 | 566 #define FXCIPHER_AES2 3 |
554 class CPDF_SecurityHandler { | 567 class CPDF_SecurityHandler { |
555 public: | 568 public: |
556 virtual ~CPDF_SecurityHandler() {} | 569 virtual ~CPDF_SecurityHandler() {} |
557 | 570 |
558 virtual FX_BOOL OnInit(CPDF_Parser* pParser, | 571 virtual FX_BOOL OnInit(CPDF_Parser* pParser, |
559 CPDF_Dictionary* pEncryptDict) = 0; | 572 CPDF_Dictionary* pEncryptDict) = 0; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 FX_DWORD src_size, | 981 FX_DWORD src_size, |
969 const CPDF_Dictionary* pDict, | 982 const CPDF_Dictionary* pDict, |
970 uint8_t*& dest_buf, | 983 uint8_t*& dest_buf, |
971 FX_DWORD& dest_size, | 984 FX_DWORD& dest_size, |
972 CFX_ByteString& ImageEncoding, | 985 CFX_ByteString& ImageEncoding, |
973 CPDF_Dictionary*& pImageParms, | 986 CPDF_Dictionary*& pImageParms, |
974 FX_DWORD estimated_size, | 987 FX_DWORD estimated_size, |
975 FX_BOOL bImageAcc); | 988 FX_BOOL bImageAcc); |
976 | 989 |
977 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 990 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
OLD | NEW |