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

Unified Diff: pdf/out_of_process_instance.cc

Issue 2558573002: Revert "reland of Improve linearized pdf load/show time." (Closed)
Patch Set: Changes to make tests pass ... 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
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 727e671157bf146579906ee3787915ee24da0a4a..c90be63d52793cb17d06c0e1334d330bf5c22ed8 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -943,8 +943,24 @@ void OutOfProcessInstance::OnPaint(
}
void OutOfProcessInstance::DidOpen(int32_t result) {
- if (result != PP_OK || !engine_->HandleDocumentLoad(embed_loader_))
+ if (result == PP_OK) {
+ if (!engine_->HandleDocumentLoad(embed_loader_)) {
+ document_load_state_ = LOAD_STATE_LOADING;
+ DocumentLoadFailed();
+ }
+ } else if (result != PP_ERROR_ABORTED) { // Can happen in tests.
+ NOTREACHED();
DocumentLoadFailed();
+ }
+
+ // If it's a progressive load, cancel the stream URL request so that requests
+ // can be made on the original URL.
+ // TODO(raymes): Make this clearer once the in-process plugin is deleted.
+ if (engine_->IsProgressiveLoad()) {
+ pp::VarDictionary message;
+ message.Set(kType, kJSCancelStreamUrlType);
+ PostMessage(message);
+ }
}
void OutOfProcessInstance::DidOpenPreview(int32_t result) {
@@ -1574,12 +1590,6 @@ uint32_t OutOfProcessInstance::GetBackgroundColor() {
return background_color_;
}
-void OutOfProcessInstance::CancelBrowserDownload() {
- pp::VarDictionary message;
- message.Set(kType, kJSCancelStreamUrlType);
- PostMessage(message);
-}
-
void OutOfProcessInstance::IsSelectingChanged(bool is_selecting) {
pp::VarDictionary message;
message.Set(kType, kJSSetIsSelectingType);
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698