summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-14 18:26:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-14 18:26:36 +0000
commit88798cff29934b58e0a8d81e94005472d612b964 (patch)
tree3b5a25faa2a627ac30de219b89c8152a9fff2f27 /core/fxcrt/xml
parentb9c3e2712f75363372622282023143b86b72f2df (diff)
downloadpdfium-88798cff29934b58e0a8d81e94005472d612b964.tar.xz
Remove CFX_BufferSeekableReadStream.
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing. Take some checks from CFX_BufferSeekableReadStream and add them CFX_ReadOnlyMemoryStream. Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f Reviewed-on: https://pdfium-review.googlesource.com/40070 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r--core/fxcrt/xml/cfx_xmlinstruction_unittest.cpp6
-rw-r--r--core/fxcrt/xml/cfx_xmlparser_unittest.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/core/fxcrt/xml/cfx_xmlinstruction_unittest.cpp b/core/fxcrt/xml/cfx_xmlinstruction_unittest.cpp
index 0109ab2985..c1fbad5f0f 100644
--- a/core/fxcrt/xml/cfx_xmlinstruction_unittest.cpp
+++ b/core/fxcrt/xml/cfx_xmlinstruction_unittest.cpp
@@ -4,10 +4,10 @@
#include "core/fxcrt/xml/cfx_xmlinstruction.h"
+#include "core/fxcrt/cfx_readonlymemorystream.h"
#include "core/fxcrt/xml/cfx_xmldocument.h"
#include "core/fxcrt/xml/cfx_xmlelement.h"
#include "core/fxcrt/xml/cfx_xmlparser.h"
-#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/string_write_stream.h"
#include "testing/test_support.h"
@@ -86,7 +86,7 @@ TEST(CFX_XMLInstructionTest, ParseAndReSave) {
"<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n"
"<node></node>";
- auto in_stream = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(
+ auto in_stream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
pdfium::as_bytes(pdfium::make_span(input)));
CFX_XMLParser parser(in_stream);
@@ -119,7 +119,7 @@ TEST(CFX_XMLInstructionTest, ParseAndReSaveInnerInstruction) {
"<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n"
"</node>";
- auto in_stream = pdfium::MakeRetain<CFX_BufferSeekableReadStream>(
+ auto in_stream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
pdfium::as_bytes(pdfium::make_span(input)));
CFX_XMLParser parser(in_stream);
diff --git a/core/fxcrt/xml/cfx_xmlparser_unittest.cpp b/core/fxcrt/xml/cfx_xmlparser_unittest.cpp
index c1236ce182..86d340ea83 100644
--- a/core/fxcrt/xml/cfx_xmlparser_unittest.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser_unittest.cpp
@@ -6,11 +6,11 @@
#include <memory>
+#include "core/fxcrt/cfx_readonlymemorystream.h"
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/xml/cfx_xmldocument.h"
#include "core/fxcrt/xml/cfx_xmlelement.h"
#include "core/fxcrt/xml/cfx_xmlinstruction.h"
-#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/test_support.h"
#include "third_party/base/ptr_util.h"
@@ -18,8 +18,8 @@
class CFX_XMLParserTest : public testing::Test {
public:
std::unique_ptr<CFX_XMLDocument> Parse(pdfium::span<const char> input) {
- CFX_XMLParser parser(pdfium::MakeRetain<CFX_BufferSeekableReadStream>(
- pdfium::as_bytes(input)));
+ CFX_XMLParser parser(
+ pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(pdfium::as_bytes(input)));
return parser.Parse();
}
};