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

Unified Diff: core/src/fxcrt/extension.h

Issue 1398383002: core/ difference with XFA (for information only). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 2015-11-24 version Created 5 years, 1 month 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/src/fxcodec/codec/fx_codec_jpeg.cpp ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/extension.h
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index a23eab5c58274effa2a9044691bcc3483e53a232..42cebdf60575d8d9856e99f88ebb782d6771e1b3 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -31,6 +31,40 @@ class IFXCRT_FileAccess {
};
IFXCRT_FileAccess* FXCRT_FileAccess_Create();
+#ifdef PDF_ENABLE_XFA
+class CFX_CRTFileAccess : public IFX_FileAccess {
+ public:
+ CFX_CRTFileAccess() : m_RefCount(0) {}
+
+ // IFX_FileAccess
+ void Release() override {
+ if (--m_RefCount == 0)
+ delete this;
+ }
+
+ IFX_FileAccess* Retain() override {
+ m_RefCount++;
+ return (IFX_FileAccess*)this;
+ }
+
+ void GetPath(CFX_WideString& wsPath) override { wsPath = m_path; }
+
+ IFX_FileStream* CreateFileStream(FX_DWORD dwModes) override {
+ return FX_CreateFileStream(m_path, dwModes);
+ }
+
+ FX_BOOL Init(const CFX_WideStringC& wsPath) {
+ m_path = wsPath;
+ m_RefCount = 1;
+ return TRUE;
+ }
+
+ protected:
+ CFX_WideString m_path;
+ FX_DWORD m_RefCount;
+};
+
+#endif
class CFX_CRTFileStream final : public IFX_FileStream {
public:
CFX_CRTFileStream(IFXCRT_FileAccess* pFA) : m_pFile(pFA), m_dwCount(1) {}
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_jpeg.cpp ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698