summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffapp_unittest.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 09:21:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 09:21:18 -0800
commit833619b4441915c7c55085d44b3221eaef0d9800 (patch)
tree68bf76e83078223ba03f490c2c13f484e40154d4 /xfa/fxfa/app/xfa_ffapp_unittest.cpp
parent8f875507a986d10335e40a5f7c1679aff9770d0a (diff)
downloadpdfium-833619b4441915c7c55085d44b3221eaef0d9800.tar.xz
Refcount all the IFX_ stream classes all the time.
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
Diffstat (limited to 'xfa/fxfa/app/xfa_ffapp_unittest.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffapp_unittest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fxfa/app/xfa_ffapp_unittest.cpp b/xfa/fxfa/app/xfa_ffapp_unittest.cpp
index 7a65dcc45b..b0879012b4 100644
--- a/xfa/fxfa/app/xfa_ffapp_unittest.cpp
+++ b/xfa/fxfa/app/xfa_ffapp_unittest.cpp
@@ -13,12 +13,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/base/ptr_util.h"
-using UniqueFileRead = std::unique_ptr<IFX_SeekableReadStream,
- ReleaseDeleter<IFX_SeekableReadStream>>;
-
TEST(CXFAFileRead, NoStreams) {
std::vector<CPDF_Stream*> streams;
- UniqueFileRead fileread(MakeSeekableReadStream(streams));
+ CFX_RetainPtr<IFX_SeekableReadStream> fileread =
+ MakeSeekableReadStream(streams);
uint8_t output_buffer[16];
memset(output_buffer, 0xbd, sizeof(output_buffer));
@@ -28,9 +26,10 @@ TEST(CXFAFileRead, NoStreams) {
TEST(CXFAFileRead, EmptyStreams) {
std::vector<CPDF_Stream*> streams;
- std::unique_ptr<CPDF_Stream> stream1 = pdfium::MakeUnique<CPDF_Stream>();
+ auto stream1 = pdfium::MakeUnique<CPDF_Stream>();
streams.push_back(stream1.get());
- UniqueFileRead fileread(MakeSeekableReadStream(streams));
+ CFX_RetainPtr<IFX_SeekableReadStream> fileread =
+ MakeSeekableReadStream(streams);
uint8_t output_buffer[16];
memset(output_buffer, 0xbd, sizeof(output_buffer));
@@ -40,9 +39,9 @@ TEST(CXFAFileRead, EmptyStreams) {
TEST(CXFAFileRead, NormalStreams) {
std::vector<CPDF_Stream*> streams;
- std::unique_ptr<CPDF_Stream> stream1 = pdfium::MakeUnique<CPDF_Stream>();
- std::unique_ptr<CPDF_Stream> stream2 = pdfium::MakeUnique<CPDF_Stream>();
- std::unique_ptr<CPDF_Stream> stream3 = pdfium::MakeUnique<CPDF_Stream>();
+ auto stream1 = pdfium::MakeUnique<CPDF_Stream>();
+ auto stream2 = pdfium::MakeUnique<CPDF_Stream>();
+ auto stream3 = pdfium::MakeUnique<CPDF_Stream>();
// 16 chars total.
stream1->InitStream(reinterpret_cast<const uint8_t*>("one t"), 5,
@@ -55,7 +54,8 @@ TEST(CXFAFileRead, NormalStreams) {
streams.push_back(stream1.get());
streams.push_back(stream2.get());
streams.push_back(stream3.get());
- UniqueFileRead fileread(MakeSeekableReadStream(streams));
+ CFX_RetainPtr<IFX_SeekableReadStream> fileread =
+ MakeSeekableReadStream(streams);
uint8_t output_buffer[16];
memset(output_buffer, 0xbd, sizeof(output_buffer));