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

Unified Diff: xfa/fxfa/app/xfa_ffapp_unittest.cpp

Issue 2451493002: Refcount all the IFX_ stream classes all the time. (Closed)
Patch Set: Clean up cast expression Created 4 years 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
« no previous file with comments | « xfa/fxfa/app/xfa_ffapp.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffapp_unittest.cpp
diff --git a/xfa/fxfa/app/xfa_ffapp_unittest.cpp b/xfa/fxfa/app/xfa_ffapp_unittest.cpp
index 7a65dcc45bbc2378463157c3ac3657c0601a5437..b0879012b42b4c3088c967a3bbd3df36edd2ccba 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));
« no previous file with comments | « xfa/fxfa/app/xfa_ffapp.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698