summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/fgas_stream.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 12:10:20 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 12:10:20 -0800
commit7cda31ac2f2884166f044937619478a6103198cf (patch)
tree640f14ab5c81696cfffdedf0644eac4b1f2bc47f /xfa/fgas/crt/fgas_stream.h
parentab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028 (diff)
downloadpdfium-7cda31ac2f2884166f044937619478a6103198cf.tar.xz
Refcount IFGAS_ streams all the time, too
IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002
Diffstat (limited to 'xfa/fgas/crt/fgas_stream.h')
-rw-r--r--xfa/fgas/crt/fgas_stream.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h
index b6552d9825..79fda58d2a 100644
--- a/xfa/fgas/crt/fgas_stream.h
+++ b/xfa/fgas/crt/fgas_stream.h
@@ -27,27 +27,23 @@ enum FX_STREAMSEEK {
FX_STREAMSEEK_End,
};
-class IFGAS_Stream {
+class IFGAS_Stream : public CFX_Retainable {
public:
- static IFGAS_Stream* CreateStream(
+ static CFX_RetainPtr<IFGAS_Stream> CreateStream(
const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead,
uint32_t dwAccess);
- static IFGAS_Stream* CreateStream(
+ static CFX_RetainPtr<IFGAS_Stream> CreateStream(
const CFX_RetainPtr<IFX_SeekableWriteStream>& pFileWrite,
uint32_t dwAccess);
- static IFGAS_Stream* CreateStream(uint8_t* pData,
- int32_t length,
- uint32_t dwAccess);
- static IFGAS_Stream* CreateTextStream(IFGAS_Stream* pBaseStream,
- bool bDeleteOnRelease);
+ static CFX_RetainPtr<IFGAS_Stream> CreateStream(uint8_t* pData,
+ int32_t length,
+ uint32_t dwAccess);
+ static CFX_RetainPtr<IFGAS_Stream> CreateTextStream(
+ const CFX_RetainPtr<IFGAS_Stream>& pBaseStream);
- virtual ~IFGAS_Stream() {}
- virtual void Release() = 0;
- virtual IFGAS_Stream* Retain() = 0;
-
- virtual IFGAS_Stream* CreateSharedStream(uint32_t dwAccess,
- int32_t iOffset,
- int32_t iLength) = 0;
+ virtual CFX_RetainPtr<IFGAS_Stream> CreateSharedStream(uint32_t dwAccess,
+ int32_t iOffset,
+ int32_t iLength) = 0;
virtual uint32_t GetAccessModes() const = 0;
virtual int32_t GetLength() const = 0;