summaryrefslogtreecommitdiff
path: root/xfa/fxfa/xfa_ffdoc.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 09:21:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 09:21:18 -0800
commit833619b4441915c7c55085d44b3221eaef0d9800 (patch)
tree68bf76e83078223ba03f490c2c13f484e40154d4 /xfa/fxfa/xfa_ffdoc.h
parent8f875507a986d10335e40a5f7c1679aff9770d0a (diff)
downloadpdfium-833619b4441915c7c55085d44b3221eaef0d9800.tar.xz
Refcount all the IFX_ stream classes all the time.
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
Diffstat (limited to 'xfa/fxfa/xfa_ffdoc.h')
-rw-r--r--xfa/fxfa/xfa_ffdoc.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/xfa/fxfa/xfa_ffdoc.h b/xfa/fxfa/xfa_ffdoc.h
index a31f6d7e50..44079704e7 100644
--- a/xfa/fxfa/xfa_ffdoc.h
+++ b/xfa/fxfa/xfa_ffdoc.h
@@ -40,7 +40,7 @@ class CXFA_FFDoc {
CXFA_FFDocView* CreateDocView(uint32_t dwView = 0);
- bool OpenDoc(IFX_SeekableReadStream* pStream, bool bTakeOverFile);
+ bool OpenDoc(const CFX_RetainPtr<IFX_SeekableReadStream>& pStream);
bool OpenDoc(CPDF_Document* pPDFDoc);
bool CloseDoc();
@@ -54,21 +54,21 @@ class CXFA_FFDoc {
int32_t& iImageYDpi);
bool SavePackage(XFA_HashCode code,
- IFX_SeekableWriteStream* pFile,
+ const CFX_RetainPtr<IFX_SeekableWriteStream>& pFile,
CXFA_ChecksumContext* pCSContext);
- bool ImportData(IFX_SeekableReadStream* pStream, bool bXDP = true);
+ bool ImportData(const CFX_RetainPtr<IFX_SeekableReadStream>& pStream,
+ bool bXDP = true);
protected:
IXFA_DocEnvironment* const m_pDocEnvironment;
std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser;
- IFX_SeekableReadStream* m_pStream;
+ CFX_RetainPtr<IFX_SeekableReadStream> m_pStream;
CXFA_FFApp* m_pApp;
std::unique_ptr<CXFA_FFNotify> m_pNotify;
CPDF_Document* m_pPDFDoc;
std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap;
std::map<uint32_t, std::unique_ptr<CXFA_FFDocView>> m_TypeToDocViewMap;
uint32_t m_dwDocType;
- bool m_bOwnStream;
};
#endif // XFA_FXFA_XFA_FFDOC_H_