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

Unified Diff: content/browser/loader/mime_sniffing_resource_handler.cc

Issue 2974493002: Fix short error responses sniffed as downloads hanging. (Closed)
Patch Set: Add comment Created 3 years, 5 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
Index: content/browser/loader/mime_sniffing_resource_handler.cc
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc
index 11adad4704772748963bc5129752c2e95af17a20..1f512613ad9a4dbcc5128d223a0161069a9b553a 100644
--- a/content/browser/loader/mime_sniffing_resource_handler.cc
+++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -545,10 +545,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
std::unique_ptr<ResourceHandler> handler(host_->MaybeInterceptAsStream(
plugin_path, request(), response_.get(), &payload));
if (handler) {
- if (!CheckResponseIsNotProvisional()) {
- Cancel();
+ if (!CheckResponseIsNotProvisional())
return false;
- }
*handled_by_plugin = true;
intercepting_handler_->UseNewHandler(std::move(handler), payload);
}
@@ -577,7 +575,7 @@ bool MimeSniffingResourceHandler::CheckResponseIsNotProvisional() {
// download.
// TODO(abarth): We should abstract the response_code test, but this kind
// of check is scattered throughout our codebase.
- request()->CancelWithError(net::ERR_INVALID_RESPONSE);
+ CancelWithError(net::ERR_INVALID_RESPONSE);
mmenke 2017/07/06 17:51:56 I verified that we should be holding onto a contro
return false;
}
« chrome/browser/net/errorpage_browsertest.cc ('K') | « chrome/browser/net/errorpage_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698