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

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2539203002: Convert loose FX_Create* functions into static methods (Closed)
Patch Set: last batch 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
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index c7cc1242fe8336e0191291a2ab5d02ae85f37cb2..1c27b6c69b49c6188f5f26e57dc218bff4f3d366 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -393,16 +393,14 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
// NOTE: the creation of the file needs to be by the embedder on the
// other side of this API.
IFX_SeekableReadStream* pFileAccess =
- FX_CreateFileRead((const FX_CHAR*)file_path);
- if (!pFileAccess) {
+ IFX_SeekableReadStream::CreateFromFilename((const FX_CHAR*)file_path);
+ if (!pFileAccess)
return nullptr;
- }
- std::unique_ptr<CPDF_Parser> pParser(new CPDF_Parser);
+ auto pParser = pdfium::MakeUnique<CPDF_Parser>();
pParser->SetPassword(password);
- std::unique_ptr<CPDF_Document> pDocument(
- new CPDF_Document(std::move(pParser)));
+ auto pDocument = pdfium::MakeUnique<CPDF_Document>(std::move(pParser));
CPDF_Parser::Error error =
pDocument->GetParser()->StartParse(pFileAccess, pDocument.get());
if (error != CPDF_Parser::SUCCESS) {

Powered by Google App Engine
This is Rietveld 408576698