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

Side by Side Diff: core/fxcrt/fx_stream.h

Issue 2562563002: Properly ref count IFX_FileAccess. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 CORE_FXCRT_FX_STREAM_H_ 7 #ifndef CORE_FXCRT_FX_STREAM_H_
8 #define CORE_FXCRT_FX_STREAM_H_ 8 #define CORE_FXCRT_FX_STREAM_H_
9 9
10 #include "core/fxcrt/cfx_retain_ptr.h" 10 #include "core/fxcrt/cfx_retain_ptr.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 FX_FILESIZE GetPosition() override = 0; 136 FX_FILESIZE GetPosition() override = 0;
137 size_t ReadBlock(void* buffer, size_t size) override = 0; 137 size_t ReadBlock(void* buffer, size_t size) override = 0;
138 138
139 virtual bool ReadNextBlock(bool bRestart = false) = 0; 139 virtual bool ReadNextBlock(bool bRestart = false) = 0;
140 virtual const uint8_t* GetBlockBuffer() = 0; 140 virtual const uint8_t* GetBlockBuffer() = 0;
141 virtual size_t GetBlockSize() = 0; 141 virtual size_t GetBlockSize() = 0;
142 virtual FX_FILESIZE GetBlockOffset() = 0; 142 virtual FX_FILESIZE GetBlockOffset() = 0;
143 }; 143 };
144 144
145 #ifdef PDF_ENABLE_XFA 145 #ifdef PDF_ENABLE_XFA
146 class IFX_FileAccess { 146 class IFX_FileAccess : public CFX_Retainable {
147 public: 147 public:
148 static IFX_FileAccess* CreateDefault(const CFX_WideStringC& wsPath); 148 static CFX_RetainPtr<IFX_FileAccess> CreateDefault(
149 const CFX_WideStringC& wsPath);
149 150
150 virtual ~IFX_FileAccess() {}
151 virtual void Release() = 0;
152 virtual IFX_FileAccess* Retain() = 0;
153 virtual void GetPath(CFX_WideString& wsPath) = 0; 151 virtual void GetPath(CFX_WideString& wsPath) = 0;
154 virtual CFX_RetainPtr<IFX_SeekableStream> CreateFileStream( 152 virtual CFX_RetainPtr<IFX_SeekableStream> CreateFileStream(
155 uint32_t dwModes) = 0; 153 uint32_t dwModes) = 0;
156 }; 154 };
157 #endif // PDF_ENABLE_XFA 155 #endif // PDF_ENABLE_XFA
158 156
159 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 157 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
160 class CFindFileData { 158 class CFindFileData {
161 public: 159 public:
162 virtual ~CFindFileData() {} 160 virtual ~CFindFileData() {}
163 HANDLE m_Handle; 161 HANDLE m_Handle;
164 bool m_bEnd; 162 bool m_bEnd;
165 }; 163 };
166 164
167 class CFindFileDataA : public CFindFileData { 165 class CFindFileDataA : public CFindFileData {
168 public: 166 public:
169 ~CFindFileDataA() override {} 167 ~CFindFileDataA() override {}
170 WIN32_FIND_DATAA m_FindData; 168 WIN32_FIND_DATAA m_FindData;
171 }; 169 };
172 170
173 class CFindFileDataW : public CFindFileData { 171 class CFindFileDataW : public CFindFileData {
174 public: 172 public:
175 ~CFindFileDataW() override {} 173 ~CFindFileDataW() override {}
176 WIN32_FIND_DATAW m_FindData; 174 WIN32_FIND_DATAW m_FindData;
177 }; 175 };
178 #endif 176 #endif
179 177
180 #endif // CORE_FXCRT_FX_STREAM_H_ 178 #endif // CORE_FXCRT_FX_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698