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

Side by Side Diff: fpdfsdk/cpdfsdk_pageview.h

Issue 2384243002: Guard against double deletion of page views. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FPDFSDK_CPDFSDK_PAGEVIEW_H_ 7 #ifndef FPDFSDK_CPDFSDK_PAGEVIEW_H_
8 #define FPDFSDK_CPDFSDK_PAGEVIEW_H_ 8 #define FPDFSDK_CPDFSDK_PAGEVIEW_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return m_fxAnnotArray; 90 return m_fxAnnotArray;
91 } 91 }
92 92
93 int GetPageIndex() const; 93 int GetPageIndex() const;
94 void LoadFXAnnots(); 94 void LoadFXAnnots();
95 void ClearFXAnnots(); 95 void ClearFXAnnots();
96 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } 96 void SetValid(FX_BOOL bValid) { m_bValid = bValid; }
97 FX_BOOL IsValid() { return m_bValid; } 97 FX_BOOL IsValid() { return m_bValid; }
98 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } 98 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; }
99 FX_BOOL IsLocked() { return m_bLocked; } 99 FX_BOOL IsLocked() { return m_bLocked; }
100
101 void SetBeingDestroyed() { m_bBeingDestroyed = true; }
102 bool IsBeingDestroyed() const { return m_bBeingDestroyed; }
103
100 #ifndef PDF_ENABLE_XFA 104 #ifndef PDF_ENABLE_XFA
101 bool OwnsPage() const { return m_bOwnsPage; } 105 bool OwnsPage() const { return m_bOwnsPage; }
102 void TakePageOwnership() { m_bOwnsPage = true; } 106 void TakePageOwnership() { m_bOwnsPage = true; }
103 #endif // PDF_ENABLE_XFA 107 #endif // PDF_ENABLE_XFA
104 108
105 private: 109 private:
106 int GetPageIndexForStaticPDF() const; 110 int GetPageIndexForStaticPDF() const;
107 111
108 CFX_Matrix m_curMatrix; 112 CFX_Matrix m_curMatrix;
109 UnderlyingPageType* const m_page; 113 UnderlyingPageType* const m_page;
110 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; 114 std::unique_ptr<CPDF_AnnotList> m_pAnnotList;
111 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; 115 std::vector<CPDFSDK_Annot*> m_fxAnnotArray;
112 CPDFSDK_Document* const m_pSDKDoc; 116 CPDFSDK_Document* const m_pSDKDoc;
113 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; 117 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget;
114 #ifndef PDF_ENABLE_XFA 118 #ifndef PDF_ENABLE_XFA
115 bool m_bOwnsPage; 119 bool m_bOwnsPage;
116 #endif // PDF_ENABLE_XFA 120 #endif // PDF_ENABLE_XFA
117 FX_BOOL m_bEnterWidget; 121 FX_BOOL m_bEnterWidget;
118 FX_BOOL m_bExitWidget; 122 FX_BOOL m_bExitWidget;
119 FX_BOOL m_bOnWidget; 123 FX_BOOL m_bOnWidget;
120 FX_BOOL m_bValid; 124 FX_BOOL m_bValid;
121 FX_BOOL m_bLocked; 125 FX_BOOL m_bLocked;
126 bool m_bBeingDestroyed;
122 }; 127 };
123 128
124 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_ 129 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698