summaryrefslogtreecommitdiff
path: root/core/fxcrt/extension.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-19 17:31:01 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-19 17:31:01 -0700
commit411f1185f44b7862a9b1c16e588407ae197752dd (patch)
treec02ce8943cd41b857c198ef5e5bc7ef847368199 /core/fxcrt/extension.h
parent1f36fa860a170081f66809d634ec7ab83d7cb25e (diff)
downloadpdfium-411f1185f44b7862a9b1c16e588407ae197752dd.tar.xz
Remove Release() from IFXCRT_FileAccess.
Remove some unused impls. Review-Url: https://codereview.chromium.org/1994323002
Diffstat (limited to 'core/fxcrt/extension.h')
-rw-r--r--core/fxcrt/extension.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxcrt/extension.h b/core/fxcrt/extension.h
index b0e7b9e117..698bded9b6 100644
--- a/core/fxcrt/extension.h
+++ b/core/fxcrt/extension.h
@@ -8,17 +8,19 @@
#define CORE_FXCRT_EXTENSION_H_
#include <algorithm>
+#include <memory>
#include "core/fxcrt/include/fx_basic.h"
#include "core/fxcrt/include/fx_safe_types.h"
class IFXCRT_FileAccess {
public:
+ static IFXCRT_FileAccess* Create();
virtual ~IFXCRT_FileAccess() {}
+
virtual FX_BOOL Open(const CFX_ByteStringC& fileName, uint32_t dwMode) = 0;
virtual FX_BOOL Open(const CFX_WideStringC& fileName, uint32_t dwMode) = 0;
virtual void Close() = 0;
- virtual void Release() = 0;
virtual FX_FILESIZE GetSize() const = 0;
virtual FX_FILESIZE GetPosition() const = 0;
virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0;
@@ -31,7 +33,6 @@ class IFXCRT_FileAccess {
virtual FX_BOOL Flush() = 0;
virtual FX_BOOL Truncate(FX_FILESIZE szFile) = 0;
};
-IFXCRT_FileAccess* FXCRT_FileAccess_Create();
#ifdef PDF_ENABLE_XFA
class CFX_CRTFileAccess : public IFX_FileAccess {
@@ -69,7 +70,7 @@ class CFX_CRTFileAccess : public IFX_FileAccess {
class CFX_CRTFileStream final : public IFX_FileStream {
public:
- explicit CFX_CRTFileStream(IFXCRT_FileAccess* pFA);
+ explicit CFX_CRTFileStream(std::unique_ptr<IFXCRT_FileAccess> pFA);
~CFX_CRTFileStream() override;
// IFX_FileStream:
@@ -86,7 +87,7 @@ class CFX_CRTFileStream final : public IFX_FileStream {
FX_BOOL Flush() override;
protected:
- IFXCRT_FileAccess* m_pFile;
+ std::unique_ptr<IFXCRT_FileAccess> m_pFile;
uint32_t m_dwCount;
};