Chromium Code Reviews| Index: pdf/pdfium/pdfium_engine.cc |
| diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc |
| index ac00af5c590d3827fb2493b4e615f44729fed331..bf0d042fe05671bdb735b6d992ff296db0b918eb 100644 |
| --- a/pdf/pdfium/pdfium_engine.cc |
| +++ b/pdf/pdfium/pdfium_engine.cc |
| @@ -298,7 +298,7 @@ FPDF_SYSFONTINFO g_font_info = { |
| }; |
| #endif // defined(OS_LINUX) |
| -PDFiumEngine* g_engine_for_unsupported; |
| +PDFiumEngine* g_engine_for_unsupported = nullptr; |
| void Unsupported_Handler(UNSUPPORT_INFO*, int type) { |
| if (!g_engine_for_unsupported) { |
| @@ -2391,10 +2391,13 @@ void PDFiumEngine::AppendBlankPages(int num_pages) { |
| void PDFiumEngine::LoadDocument() { |
| // Check if the document is ready for loading. If it isn't just bail for now, |
| // we will call LoadDocument() again later. |
| - if (!doc_ && !doc_loader_.IsDocumentComplete() && |
| - !FPDFAvail_IsDocAvail(fpdf_availability_, &download_hints_)) { |
|
Wei Li
2016/05/24 00:21:27
Should these conditions be ORed instead?
Lei Zhang
2016/05/25 17:16:36
No, we have to continue past this point to turn |d
|
| + if (!doc_ && !doc_loader_.IsDocumentComplete()) |
| + return; |
| + |
| + // Always call FPDFAvail_IsDocAvail() so PDFium initializes internal data |
| + // structures. |
| + if (!FPDFAvail_IsDocAvail(fpdf_availability_, &download_hints_)) |
| return; |
| - } |
| // If we're in the middle of getting a password, just return. We will retry |
| // loading the document after we get the password anyway. |