summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/include
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-11 14:43:40 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-11 14:43:41 -0700
commit5a6c1398d0e559fb6a048cb0dca46ba9f9309a77 (patch)
tree40193eaf374d0f9bf2ec2f257871279b0f36efb8 /core/fpdfdoc/include
parentac14258c429141653f73ca5c1b64ad259ac15804 (diff)
downloadpdfium-5a6c1398d0e559fb6a048cb0dca46ba9f9309a77.tar.xz
Use smart pointers for class owned member variables
Replace raw member variables to smart pointer type to better maintain the ownership and to ease the management. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2136683002
Diffstat (limited to 'core/fpdfdoc/include')
-rw-r--r--core/fpdfdoc/include/fpdf_doc.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index afa5a30b18..be52a1b829 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