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

Unified Diff: pdf/pdfium/pdfium_engine.h

Issue 2349753003: Improve linearized pdf load/show time. (Closed)
Patch Set: rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/pdf_engine.h ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.h
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h
index 89406c7dd3711fe807e51cd136efd61fcbd53f40..5135371b4e9905bc6e965a04aadafb12d04b15d4 100644
--- a/pdf/pdfium/pdfium_engine.h
+++ b/pdf/pdfium/pdfium_engine.h
@@ -108,16 +108,16 @@ class PDFiumEngine : public PDFEngine,
#if defined(PDF_ENABLE_XFA)
void SetScrollPosition(const pp::Point& position) override;
#endif
- bool IsProgressiveLoad() override;
std::string GetMetadata(const std::string& key) override;
// DocumentLoader::Client implementation.
pp::Instance* GetPluginInstance() override;
- pp::URLLoader CreateURLLoader() override;
- void OnPartialDocumentLoaded() override;
+ std::unique_ptr<URLLoaderWrapper> CreateURLLoader() override;
void OnPendingRequestComplete() override;
void OnNewDataAvailable() override;
void OnDocumentComplete() override;
+ void OnDocumentCanceled() override;
+ void CancelBrowserDownload() override;
void UnsupportedFeature(int type);
void FontSubstituted();
@@ -191,11 +191,11 @@ class PDFiumEngine : public PDFEngine,
friend class SelectionChangeInvalidator;
struct FileAvail : public FX_FILEAVAIL {
- DocumentLoader* loader;
+ PDFiumEngine* engine;
};
struct DownloadHints : public FX_DOWNLOADHINTS {
- DocumentLoader* loader;
+ PDFiumEngine* engine;
};
// PDFium interface to get block of data.
@@ -602,7 +602,7 @@ class PDFiumEngine : public PDFEngine,
double current_zoom_;
unsigned int current_rotation_;
- DocumentLoader doc_loader_; // Main document's loader.
+ std::unique_ptr<DocumentLoader> doc_loader_; // Main document's loader.
std::string url_;
std::string headers_;
pp::CompletionCallbackFactory<PDFiumEngine> find_factory_;
@@ -733,6 +733,11 @@ class PDFiumEngine : public PDFEngine,
// to false after the user finishes getting their password.
bool getting_password_;
+ // While true, the document try to be opened and parsed after download each
+ // part. Else the document will be opened and parsed only on finish of
+ // downloading.
+ bool process_when_pending_request_complete_ = true;
+
DISALLOW_COPY_AND_ASSIGN(PDFiumEngine);
};
« no previous file with comments | « pdf/pdf_engine.h ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698