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

Unified Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2520493002: Make CPDF_Stream() take unique_ptr's to its dictionary. (Closed)
Patch Set: rebase, lint, fix new test. Created 4 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 | « fpdfsdk/formfiller/cba_fontmap.cpp ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_flatten.cpp
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index ccbb7b876586ffb59b34a122f71eb9cdfabd0c8e..e649bacf49755dd73814242025d4b9bb0f2466e5 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -178,7 +178,8 @@ CFX_FloatRect CalculateRect(std::vector<CFX_FloatRect>* pRectArray) {
uint32_t NewIndirectContentsStream(const CFX_ByteString& key,
CPDF_Document* pDocument) {
CPDF_Stream* pNewContents = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
pNewContents->SetData(sStream.raw_str(), sStream.GetLength());
@@ -296,7 +297,8 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pRes = pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
CPDF_Stream* pNewXObject = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
uint32_t dwObjNum = pNewXObject->GetObjNum();
CPDF_Dictionary* pPageXObject = pRes->GetDictFor("XObject");
« no previous file with comments | « fpdfsdk/formfiller/cba_fontmap.cpp ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698