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

Unified Diff: xfa/fgas/crt/fgas_stream.cpp

Issue 2560783003: Catch stray Retains() and Releases() outside of RetainPtr<>. (Closed)
Patch Set: override required per chrome style Created 4 years 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/fxcrt/fx_xml_parser.cpp ('k') | xfa/fxfa/parser/cxfa_widetextread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/crt/fgas_stream.cpp
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 966f615676feff74cba9a062174649187ff1bec8..424b191cb8e1715697f9f812b133db080696d7cb 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -194,8 +194,8 @@ enum FX_STREAMTYPE {
class CFGAS_Stream : public IFGAS_Stream {
public:
- CFGAS_Stream();
- ~CFGAS_Stream() override;
+ template <typename T, typename... Args>
+ friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
@@ -227,6 +227,9 @@ class CFGAS_Stream : public IFGAS_Stream {
int32_t iLength) override;
protected:
+ CFGAS_Stream();
+ ~CFGAS_Stream() override;
+
FX_STREAMTYPE m_eStreamType;
IFGAS_StreamImp* m_pStreamImp;
uint32_t m_dwAccess;
@@ -239,8 +242,8 @@ class CFGAS_Stream : public IFGAS_Stream {
class CFGAS_TextStream : public IFGAS_Stream {
public:
- explicit CFGAS_TextStream(const CFX_RetainPtr<IFGAS_Stream>& pStream);
- ~CFGAS_TextStream() override;
+ template <typename T, typename... Args>
+ friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
// IFGAS_Stream
uint32_t GetAccessModes() const override;
@@ -262,6 +265,9 @@ class CFGAS_TextStream : public IFGAS_Stream {
int32_t iLength) override;
protected:
+ explicit CFGAS_TextStream(const CFX_RetainPtr<IFGAS_Stream>& pStream);
+ ~CFGAS_TextStream() override;
+
void InitStream();
uint16_t m_wCodePage;
« no previous file with comments | « core/fxcrt/fx_xml_parser.cpp ('k') | xfa/fxfa/parser/cxfa_widetextread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698