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

Unified Diff: core/include/fpdfapi/fpdf_objects.h

Issue 1415163009: Cleanup CPDF_Stream: (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 1 month 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 | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/fpdf_objects.h
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index d6050aec0b5485caf78d72ce8a5fc60c395e66d4..11589e65a29c597b0d98462c07b71b875dd0922e 100644
--- a/core/include/fpdfapi/fpdf_objects.h
+++ b/core/include/fpdfapi/fpdf_objects.h
@@ -466,12 +466,6 @@ inline const CPDF_Dictionary* ToDictionary(const CPDF_Object* obj) {
class CPDF_Stream : public CPDF_Object {
public:
- static CPDF_Stream* Create(uint8_t* pData,
- FX_DWORD size,
- CPDF_Dictionary* pDict) {
- return new CPDF_Stream(pData, size, pDict);
- }
-
CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict);
CPDF_Dictionary* GetDict() const { return m_pDict; }
@@ -483,7 +477,7 @@ class CPDF_Stream : public CPDF_Object {
void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict);
- void InitStream(IFX_FileRead* pFile, CPDF_Dictionary* pDict);
+ void InitStreamFromFile(IFX_FileRead* pFile, CPDF_Dictionary* pDict);
FX_BOOL Identical(CPDF_Stream* pOther) const;
@@ -493,11 +487,17 @@ class CPDF_Stream : public CPDF_Object {
uint8_t* pBuf,
FX_DWORD buf_size) const;
- FX_BOOL IsMemoryBased() const { return m_GenNum == (FX_DWORD)-1; }
+ FX_BOOL IsMemoryBased() const { return m_GenNum == kMemoryBasedGenNum; }
protected:
+ friend class CPDF_Object;
+ friend class CPDF_StreamAcc;
+
+ static const FX_DWORD kMemoryBasedGenNum = (FX_DWORD)-1;
~CPDF_Stream();
+ void InitStreamInternal(CPDF_Dictionary* pDict);
+
CPDF_Dictionary* m_pDict;
FX_DWORD m_dwSize;
@@ -509,15 +509,6 @@ class CPDF_Stream : public CPDF_Object {
IFX_FileRead* m_pFile;
};
-
- FX_FILESIZE m_FileOffset;
-
- CPDF_CryptoHandler* m_pCryptoHandler;
-
- void InitStream(CPDF_Dictionary* pDict);
- friend class CPDF_Object;
- friend class CPDF_StreamAcc;
- friend class CPDF_AttachmentAcc;
};
inline CPDF_Stream* ToStream(CPDF_Object* obj) {
return obj ? obj->AsStream() : nullptr;
@@ -540,7 +531,7 @@ class CPDF_StreamAcc {
const CPDF_Stream* GetStream() const { return m_pStream; }
CPDF_Dictionary* GetDict() const {
- return m_pStream ? m_pStream->GetDict() : NULL;
+ return m_pStream ? m_pStream->GetDict() : nullptr;
}
const uint8_t* GetData() const;
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698