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

Unified Diff: pdf/document_loader.cc

Issue 672333002: fix PDF load issue (414827) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/document_loader.cc
diff --git a/pdf/document_loader.cc b/pdf/document_loader.cc
index 6b871d60850964f015d3c4ef5d2d0f0c1e3fbf58..b2628a62712ec383fb9fa38f872dc20312c4d349 100644
--- a/pdf/document_loader.cc
+++ b/pdf/document_loader.cc
@@ -298,6 +298,15 @@ void DocumentLoader::DidOpen(int32_t result) {
return;
}
+ int32_t http_code = loader_.GetResponseInfo().GetStatusCode();
+ if (http_code >= 400 && http_code < 500) {
+ // Error accessing resource. 4xx error indicate subsequent requests
+ // will fail too.
+ // E.g. resource has been removed from the server while loading it.
+ // https://code.google.com/p/chromium/issues/detail?id=414827
+ return;
+ }
+
is_multipart_ = false;
current_chunk_size_ = 0;
current_chunk_read_ = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698