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

Side by Side Diff: fpdfsdk/fpdfview.cpp

Issue 2267173005: Removing CPDF_Parser::CloseParser. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_parser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 IFX_FileRead* pFileAccess = FX_CreateFileRead((const FX_CHAR*)file_path); 360 IFX_FileRead* pFileAccess = FX_CreateFileRead((const FX_CHAR*)file_path);
361 if (!pFileAccess) { 361 if (!pFileAccess) {
362 return nullptr; 362 return nullptr;
363 } 363 }
364 364
365 std::unique_ptr<CPDF_Parser> pParser(new CPDF_Parser); 365 std::unique_ptr<CPDF_Parser> pParser(new CPDF_Parser);
366 pParser->SetPassword(password); 366 pParser->SetPassword(password);
367 367
368 std::unique_ptr<CPDF_Document> pDocument( 368 std::unique_ptr<CPDF_Document> pDocument(
369 new CPDF_Document(std::move(pParser))); 369 new CPDF_Document(std::move(pParser)));
370 CPDF_Parser::Error error = pParser->StartParse(pFileAccess, pDocument.get()); 370 CPDF_Parser::Error error =
371 pDocument->GetParser()->StartParse(pFileAccess, pDocument.get());
371 if (error != CPDF_Parser::SUCCESS) { 372 if (error != CPDF_Parser::SUCCESS) {
372 ProcessParseError(error); 373 ProcessParseError(error);
373 return nullptr; 374 return nullptr;
374 } 375 }
375 #ifdef PDF_ENABLE_XFA 376 #ifdef PDF_ENABLE_XFA
376 return new CPDFXFA_Document(std::move(pDocument), CPDFXFA_App::GetInstance()); 377 return new CPDFXFA_Document(std::move(pDocument), CPDFXFA_App::GetInstance());
377 #else // PDF_ENABLE_XFA 378 #else // PDF_ENABLE_XFA
378 return pDocument.release(); 379 return pDocument.release();
379 #endif // PDF_ENABLE_XFA 380 #endif // PDF_ENABLE_XFA
380 } 381 }
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 if (!buffer) { 1117 if (!buffer) {
1117 *buflen = len; 1118 *buflen = len;
1118 } else if (*buflen >= len) { 1119 } else if (*buflen >= len) {
1119 memcpy(buffer, utf16Name.c_str(), len); 1120 memcpy(buffer, utf16Name.c_str(), len);
1120 *buflen = len; 1121 *buflen = len;
1121 } else { 1122 } else {
1122 *buflen = -1; 1123 *buflen = -1;
1123 } 1124 }
1124 return (FPDF_DEST)pDestObj; 1125 return (FPDF_DEST)pDestObj;
1125 } 1126 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698