summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-26 15:14:35 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-27 19:53:13 +0000
commit6e72b2ecdb95f000dede3c80e0c32496c0b27a18 (patch)
tree36350bea8b8ee81449693f8667c62fff1cedbcea /core/fpdfapi
parent827db14d7f3d0085253b686587717361ffbcad1b (diff)
downloadpdfium-6e72b2ecdb95f000dede3c80e0c32496c0b27a18.tar.xz
Remove more |new|s, part 2
Change-Id: I13b43ceafc6a35bcc1e366546a4a408ea01fe4ab Reviewed-on: https://pdfium-review.googlesource.com/4534 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/parser/cpdf_parser_unittest.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser_unittest.cpp b/core/fpdfapi/parser/cpdf_parser_unittest.cpp
index bbf707a34d..f988f8248b 100644
--- a/core/fpdfapi/parser/cpdf_parser_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_parser_unittest.cpp
@@ -16,12 +16,8 @@
// Provide a way to read test data from a buffer instead of a file.
class CFX_TestBufferRead : public IFX_SeekableReadStream {
public:
- static CFX_RetainPtr<CFX_TestBufferRead> Create(
- const unsigned char* buffer_in,
- size_t buf_size) {
- return CFX_RetainPtr<CFX_TestBufferRead>(
- new CFX_TestBufferRead(buffer_in, buf_size));
- }
+ template <typename T, typename... Args>
+ friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
// IFX_SeekableReadStream:
bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override {
@@ -62,11 +58,9 @@ class CPDF_TestParser : public CPDF_Parser {
// Setup reading from a buffer and initial states.
bool InitTestFromBuffer(const unsigned char* buffer, size_t len) {
- CFX_RetainPtr<CFX_TestBufferRead> buffer_reader =
- CFX_TestBufferRead::Create(buffer, len);
-
// For the test file, the header is set at the beginning.
- m_pSyntax->InitParser(buffer_reader, 0);
+ m_pSyntax->InitParser(pdfium::MakeRetain<CFX_TestBufferRead>(buffer, len),
+ 0);
return true;
}