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

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: After bidi Created 5 years, 2 months 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
Index: core/src/fxcrt/extension.h
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index a712fa37701aa3da552810e93ecbf1e46b7ca9f0..5c5cf59aad1687b197264772e6572474c674f9e3 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) {}

Powered by Google App Engine
This is Rietveld 408576698