From 962c1bc7e550b9466d802b0b94322693611fa30b Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 22 Aug 2018 17:27:41 +0000 Subject: Use UnownedPtr<> in CPDFSDK_FileWriteAdapter. Make member naming match chromium conventions. Change-Id: Iaa88d1446d445da3a059a339b35a5ef2152811ff Reviewed-on: https://pdfium-review.googlesource.com/40952 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fpdfsdk/cpdfsdk_filewriteadapter.cpp | 9 ++++----- fpdfsdk/cpdfsdk_filewriteadapter.h | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/cpdfsdk_filewriteadapter.cpp b/fpdfsdk/cpdfsdk_filewriteadapter.cpp index 8fc269402b..85fff8e89c 100644 --- a/fpdfsdk/cpdfsdk_filewriteadapter.cpp +++ b/fpdfsdk/cpdfsdk_filewriteadapter.cpp @@ -6,16 +6,15 @@ #include "fpdfsdk/cpdfsdk_filewriteadapter.h" -CPDFSDK_FileWriteAdapter::CPDFSDK_FileWriteAdapter( - FPDF_FILEWRITE* fileWriteStruct) - : fileWriteStruct_(fileWriteStruct) { - ASSERT(fileWriteStruct_); +CPDFSDK_FileWriteAdapter::CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE* file_write) + : file_write_(file_write) { + ASSERT(file_write_); } CPDFSDK_FileWriteAdapter::~CPDFSDK_FileWriteAdapter() {} bool CPDFSDK_FileWriteAdapter::WriteBlock(const void* data, size_t size) { - return fileWriteStruct_->WriteBlock(fileWriteStruct_, data, size) != 0; + return file_write_->WriteBlock(file_write_.Get(), data, size) != 0; } bool CPDFSDK_FileWriteAdapter::WriteString(const ByteStringView& str) { diff --git a/fpdfsdk/cpdfsdk_filewriteadapter.h b/fpdfsdk/cpdfsdk_filewriteadapter.h index e452d1cc20..3d5dbfd453 100644 --- a/fpdfsdk/cpdfsdk_filewriteadapter.h +++ b/fpdfsdk/cpdfsdk_filewriteadapter.h @@ -9,6 +9,7 @@ #include "core/fxcrt/fx_stream.h" #include "core/fxcrt/retain_ptr.h" +#include "core/fxcrt/unowned_ptr.h" #include "public/fpdf_save.h" class CPDFSDK_FileWriteAdapter : public IFX_WriteStream { @@ -21,10 +22,10 @@ class CPDFSDK_FileWriteAdapter : public IFX_WriteStream { bool WriteString(const ByteStringView& str) override; private: - explicit CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE* fileWriteStruct); + explicit CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE* file_write); ~CPDFSDK_FileWriteAdapter() override; - FPDF_FILEWRITE* fileWriteStruct_; + UnownedPtr file_write_; }; #endif // FPDFSDK_CPDFSDK_FILEWRITEADAPTER_H_ -- cgit v1.2.3