summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn4
-rw-r--r--testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc2
-rw-r--r--testing/libfuzzer/pdf_css_fuzzer.cc2
-rw-r--r--xfa/fde/css/cfde_csstextbuf.h2
-rw-r--r--xfa/fde/css/fde_css.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp_unittest.cpp2
-rw-r--r--xfa/fgas/crt/ifgas_stream.cpp (renamed from xfa/fgas/crt/fgas_stream.cpp)113
-rw-r--r--xfa/fgas/crt/ifgas_stream.h (renamed from xfa/fgas/crt/fgas_stream.h)7
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.h2
-rw-r--r--xfa/fxfa/parser/cxfa_widetextread.h2
-rw-r--r--xfa/fxfa/parser/xfa_utils.h2
12 files changed, 71 insertions, 71 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 45253c5f1a..bed74a05e7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1380,8 +1380,8 @@ if (pdf_enable_xfa) {
"xfa/fgas/crt/fgas_codepage.cpp",
"xfa/fgas/crt/fgas_codepage.h",
"xfa/fgas/crt/fgas_language.h",
- "xfa/fgas/crt/fgas_stream.cpp",
- "xfa/fgas/crt/fgas_stream.h",
+ "xfa/fgas/crt/ifgas_stream.cpp",
+ "xfa/fgas/crt/ifgas_stream.h",
"xfa/fgas/font/cfgas_fontmgr.cpp",
"xfa/fgas/font/cfgas_fontmgr.h",
"xfa/fgas/font/cfgas_gefont.cpp",
diff --git a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
index d99457d360..3be8e014ee 100644
--- a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
+++ b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
@@ -6,7 +6,7 @@
#include "core/fxcrt/cfx_retain_ptr.h"
#include "xfa/fde/xml/cfx_saxreader.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fxfa/parser/cxfa_widetextread.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/testing/libfuzzer/pdf_css_fuzzer.cc b/testing/libfuzzer/pdf_css_fuzzer.cc
index f02f006ea0..7566bb1ca2 100644
--- a/testing/libfuzzer/pdf_css_fuzzer.cc
+++ b/testing/libfuzzer/pdf_css_fuzzer.cc
@@ -8,7 +8,7 @@
#include "core/fxcrt/fx_string.h"
#include "xfa/fde/css/cfde_csssyntaxparser.h"
#include "xfa/fde/css/fde_css.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fxfa/parser/cxfa_widetextread.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/xfa/fde/css/cfde_csstextbuf.h b/xfa/fde/css/cfde_csstextbuf.h
index 9ade44be8a..52c76210ce 100644
--- a/xfa/fde/css/cfde_csstextbuf.h
+++ b/xfa/fde/css/cfde_csstextbuf.h
@@ -10,7 +10,7 @@
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/fx_system.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CFDE_CSSTextBuf {
public:
diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h
index 58a6778732..ae4f36c93d 100644
--- a/xfa/fde/css/fde_css.h
+++ b/xfa/fde/css/fde_css.h
@@ -8,7 +8,7 @@
#define XFA_FDE_CSS_FDE_CSS_H_
#include "core/fxge/fx_dib.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
enum FDE_CSSVALUETYPE {
diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h
index ad2ccc467c..09cdcbacdf 100644
--- a/xfa/fde/xml/fde_xml_imp.h
+++ b/xfa/fde/xml/fde_xml_imp.h
@@ -14,7 +14,7 @@
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_system.h"
#include "xfa/fde/xml/fde_xml.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CFDE_BlockBuffer;
class CFDE_XMLInstruction;
diff --git a/xfa/fde/xml/fde_xml_imp_unittest.cpp b/xfa/fde/xml/fde_xml_imp_unittest.cpp
index 6191025fd2..3bd46ab77c 100644
--- a/xfa/fde/xml/fde_xml_imp_unittest.cpp
+++ b/xfa/fde/xml/fde_xml_imp_unittest.cpp
@@ -7,7 +7,7 @@
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
TEST(CFDE_XMLSyntaxParser, CData) {
const wchar_t* input =
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/ifgas_stream.cpp
index 02096d4966..eef19a59ff 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/ifgas_stream.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \
_FX_OS_ == _FX_WIN64_
@@ -321,50 +321,6 @@ bool FileSetSize(FXSYS_FILE* file, int32_t size) {
#endif
}
-} // namespace
-
-// static
-CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(
- const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead,
- uint32_t dwAccess) {
- auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
- if (!pSR->LoadFileRead(pFileRead, dwAccess))
- return nullptr;
-
- if (dwAccess & FX_STREAMACCESS_Text)
- return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
-
- return pSR;
-}
-
-// static
-CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(
- const CFX_RetainPtr<IFX_SeekableWriteStream>& pFileWrite,
- uint32_t dwAccess) {
- auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
- if (!pSR->LoadFileWrite(pFileWrite, dwAccess))
- return nullptr;
-
- if (dwAccess & FX_STREAMACCESS_Text)
- return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
-
- return pSR;
-}
-
-// static
-CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(uint8_t* pData,
- int32_t length,
- uint32_t dwAccess) {
- auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
- if (!pSR->LoadBuffer(pData, length, dwAccess))
- return nullptr;
-
- if (dwAccess & FX_STREAMACCESS_Text)
- return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
-
- return pSR;
-}
-
IFGAS_StreamImp::IFGAS_StreamImp() : m_dwAccess(0) {}
CFGAS_FileStreamImp::CFGAS_FileStreamImp() : m_hFile(nullptr), m_iLength(0) {}
@@ -898,13 +854,6 @@ int32_t CFGAS_BufferStreamImp::WriteString(const wchar_t* pStr,
return iLen;
}
-// static
-CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateTextStream(
- const CFX_RetainPtr<IFGAS_Stream>& pBaseStream) {
- ASSERT(pBaseStream);
- return pdfium::MakeRetain<CFGAS_TextStream>(pBaseStream);
-}
-
CFGAS_TextStream::CFGAS_TextStream(const CFX_RetainPtr<IFGAS_Stream>& pStream)
: m_wCodePage(FX_CODEPAGE_DefANSI),
m_wBOMLength(0),
@@ -1453,10 +1402,6 @@ CFX_RetainPtr<IFGAS_Stream> CFGAS_Stream::CreateSharedStream(uint32_t dwAccess,
return pShared;
}
-CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() {
- return CFGAS_FileRead::Create(CFX_RetainPtr<IFGAS_Stream>(this));
-}
-
CFX_RetainPtr<CFGAS_FileRead> CFGAS_FileRead::Create(
const CFX_RetainPtr<IFGAS_Stream>& pStream) {
return pdfium::MakeRetain<CFGAS_FileRead>(pStream);
@@ -1478,3 +1423,59 @@ bool CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) {
int32_t iLen = m_pStream->ReadData((uint8_t*)buffer, (int32_t)size);
return iLen == (int32_t)size;
}
+
+} // namespace
+
+// static
+CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(
+ const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead,
+ uint32_t dwAccess) {
+ auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
+ if (!pSR->LoadFileRead(pFileRead, dwAccess))
+ return nullptr;
+
+ if (dwAccess & FX_STREAMACCESS_Text)
+ return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
+
+ return pSR;
+}
+
+// static
+CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(
+ const CFX_RetainPtr<IFX_SeekableWriteStream>& pFileWrite,
+ uint32_t dwAccess) {
+ auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
+ if (!pSR->LoadFileWrite(pFileWrite, dwAccess))
+ return nullptr;
+
+ if (dwAccess & FX_STREAMACCESS_Text)
+ return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
+
+ return pSR;
+}
+
+// static
+CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateStream(uint8_t* pData,
+ int32_t length,
+ uint32_t dwAccess) {
+ auto pSR = pdfium::MakeRetain<CFGAS_Stream>();
+ if (!pSR->LoadBuffer(pData, length, dwAccess))
+ return nullptr;
+
+ if (dwAccess & FX_STREAMACCESS_Text)
+ return pdfium::MakeRetain<CFGAS_TextStream>(pSR);
+
+ return pSR;
+}
+
+// static
+CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateTextStream(
+ const CFX_RetainPtr<IFGAS_Stream>& pBaseStream) {
+ ASSERT(pBaseStream);
+ return pdfium::MakeRetain<CFGAS_TextStream>(pBaseStream);
+}
+
+// static
+CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() {
+ return CFGAS_FileRead::Create(CFX_RetainPtr<IFGAS_Stream>(this));
+}
diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/ifgas_stream.h
index fdfc08205a..3ffead96dd 100644
--- a/xfa/fgas/crt/fgas_stream.h
+++ b/xfa/fgas/crt/ifgas_stream.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FGAS_CRT_FGAS_STREAM_H_
-#define XFA_FGAS_CRT_FGAS_STREAM_H_
+#ifndef XFA_FGAS_CRT_IFGAS_STREAM_H_
+#define XFA_FGAS_CRT_IFGAS_STREAM_H_
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_stream.h"
@@ -63,5 +63,4 @@ class IFGAS_Stream : public CFX_Retainable {
CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream();
};
-
-#endif // XFA_FGAS_CRT_FGAS_STREAM_H_
+#endif // XFA_FGAS_CRT_IFGAS_STREAM_H_
diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h
index 5918a23143..dc1dfff394 100644
--- a/xfa/fgas/font/cfgas_fontmgr.h
+++ b/xfa/fgas/font/cfgas_fontmgr.h
@@ -19,7 +19,7 @@
#include "core/fxge/fx_freetype.h"
#include "core/fxge/ifx_systemfontinfo.h"
#include "third_party/freetype/include/freetype/fttypes.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#define FX_FONTSTYLE_Normal 0x00
#define FX_FONTSTYLE_FixedPitch 0x01
diff --git a/xfa/fxfa/parser/cxfa_widetextread.h b/xfa/fxfa/parser/cxfa_widetextread.h
index 3850660fbd..e6abac5adb 100644
--- a/xfa/fxfa/parser/cxfa_widetextread.h
+++ b/xfa/fxfa/parser/cxfa_widetextread.h
@@ -8,7 +8,7 @@
#define XFA_FXFA_PARSER_CXFA_WIDETEXTREAD_H_
#include "core/fxcrt/cfx_retain_ptr.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
class CXFA_WideTextRead : public IFGAS_Stream {
public:
diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h
index c3111795da..b428a89b4e 100644
--- a/xfa/fxfa/parser/xfa_utils.h
+++ b/xfa/fxfa/parser/xfa_utils.h
@@ -8,7 +8,7 @@
#define XFA_FXFA_PARSER_XFA_UTILS_H_
#include "xfa/fde/xml/fde_xml.h"
-#include "xfa/fgas/crt/fgas_stream.h"
+#include "xfa/fgas/crt/ifgas_stream.h"
#include "xfa/fxfa/fxfa_basic.h"
class CFDE_XMLElement;