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

Unified Diff: core/fpdfdoc/include/fpdf_doc.h

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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/fpdfdoc/doc_annot.cpp ('k') | fpdfsdk/fsdk_mgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/include/fpdf_doc.h
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index afa5a30b1877c59831c7c910b4d118726c18580e..be52a1b8293d75b6646883254edecf5d22c1a9ee 100644
--- a/core/fpdfdoc/include/fpdf_doc.h
+++ b/core/fpdfdoc/include/fpdf_doc.h
@@ -374,8 +374,10 @@ class CPDF_AnnotList {
CPDF_RenderOptions* pOptions,
FX_RECT* pClipRect);
size_t Count() const { return m_AnnotList.size(); }
- CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index]; }
- const std::vector<CPDF_Annot*>& All() const { return m_AnnotList; }
+ CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index].get(); }
+ const std::vector<std::unique_ptr<CPDF_Annot>>& All() const {
+ return m_AnnotList;
+ }
CPDF_Document* GetDocument() const { return m_pDocument; }
protected:
@@ -389,7 +391,7 @@ class CPDF_AnnotList {
FX_RECT* clip_rect);
CPDF_Document* const m_pDocument;
- std::vector<CPDF_Annot*> m_AnnotList;
+ std::vector<std::unique_ptr<CPDF_Annot>> m_AnnotList;
};
#define COLORTYPE_TRANSPARENT 0
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | fpdfsdk/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698