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

Unified Diff: core/fpdfapi/fpdf_parser/cfdf_document.cpp

Issue 2345063002: Use string pools in some dictionaries (Closed)
Patch Set: windows compile Created 4 years, 3 months 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 | « core/fpdfapi/fpdf_page/pageint.h ('k') | core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cfdf_document.cpp
diff --git a/core/fpdfapi/fpdf_parser/cfdf_document.cpp b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
index c602f634ad9ecd13b5c8d065bf35ecff084150b3..128c513c60e32bc0a40d6db5c0ce918ddab8757a 100644
--- a/core/fpdfapi/fpdf_parser/cfdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
@@ -14,18 +14,21 @@ CFDF_Document::CFDF_Document()
: CPDF_IndirectObjectHolder(),
m_pRootDict(nullptr),
m_pFile(nullptr),
- m_bOwnFile(FALSE) {}
+ m_bOwnFile(FALSE),
+ m_pByteStringPool(WrapUnique(new CFX_ByteStringPool)) {}
CFDF_Document::~CFDF_Document() {
if (m_bOwnFile && m_pFile)
m_pFile->Release();
+ m_pByteStringPool.Clear(); // Make weak.
}
CFDF_Document* CFDF_Document::CreateNewDoc() {
CFDF_Document* pDoc = new CFDF_Document;
- pDoc->m_pRootDict = new CPDF_Dictionary;
+ pDoc->m_pRootDict = new CPDF_Dictionary(pDoc->GetByteStringPool());
pDoc->AddIndirectObject(pDoc->m_pRootDict);
- pDoc->m_pRootDict->SetFor("FDF", new CPDF_Dictionary);
+ pDoc->m_pRootDict->SetFor("FDF",
+ new CPDF_Dictionary(pDoc->GetByteStringPool()));
return pDoc;
}
« no previous file with comments | « core/fpdfapi/fpdf_page/pageint.h ('k') | core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698