diff options
author | dsinclair <dsinclair@chromium.org> | 2016-08-24 11:58:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-24 11:58:24 -0700 |
commit | 156de02596e91490bf2432686d0d3c91a5c1a26e (patch) | |
tree | 9990a3cc234c6f3fccfb95201af7bd49f96c4b47 /fpdfsdk/fpdfview.cpp | |
parent | 0e3e890ba53ee7900ba44ebe50fecba21d086bfc (diff) | |
download | pdfium-156de02596e91490bf2432686d0d3c91a5c1a26e.tar.xz |
Removing CPDF_Parser::CloseParser.chromium/2839
Currently the only calls to CloseParser() happend in the destructor or the
start*Parse methods. The Start*Parse methods are currently only called on
freshly constructed parsers in fpdf_dataavail and fpdfview.
This CL removes the CloseParser() method and puts the contents in the
destructor. We then add an ASSERT that we don't re-enter the parser after it
has already completed the parse.
Review-Url: https://codereview.chromium.org/2267173005
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 0c3a95d094..dee71ac9e2 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -367,7 +367,8 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, std::unique_ptr<CPDF_Document> pDocument( new CPDF_Document(std::move(pParser))); - CPDF_Parser::Error error = pParser->StartParse(pFileAccess, pDocument.get()); + CPDF_Parser::Error error = + pDocument->GetParser()->StartParse(pFileAccess, pDocument.get()); if (error != CPDF_Parser::SUCCESS) { ProcessParseError(error); return nullptr; |