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

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

Issue 2510083003: PlzNavigate: properly update NavigationHandle for 204/205 and download responses (Closed)
Patch Set: . Created 4 years, 1 month 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/navigation_resource_handler.cc
diff --git a/content/browser/loader/navigation_resource_handler.cc b/content/browser/loader/navigation_resource_handler.cc
index dc73b854bea71788845ddf9f8114a42eb1427d92..384248bbc2ddef24fdc733c23d343ed9f9f0fd86 100644
--- a/content/browser/loader/navigation_resource_handler.cc
+++ b/content/browser/loader/navigation_resource_handler.cc
@@ -94,16 +94,6 @@ bool NavigationResourceHandler::OnResponseStarted(ResourceResponse* response,
ResourceRequestInfoImpl* info = GetRequestInfo();
- // If the MimeTypeResourceHandler intercepted this request and converted it
- // into a download, it will still call OnResponseStarted and immediately
- // cancel. Ignore the call; OnReadCompleted will happen shortly.
- //
- // TODO(davidben): Move the dispatch out of MimeTypeResourceHandler. Perhaps
- // all the way to the UI thread. Downloads, user certificates, etc., should be
- // dispatched at the navigation layer.
- if (info->IsDownload())
- return true;
-
StreamContext* stream_context =
GetStreamContextForResourceContext(info->GetContext());
writer_.InitializeStream(stream_context->registry(),
@@ -129,14 +119,15 @@ bool NavigationResourceHandler::OnResponseStarted(ResourceResponse* response,
}
core_->NotifyResponseStarted(response, writer_.stream()->CreateHandle(),
- ssl_status, std::move(cloned_data));
- // Don't defer stream based requests. This includes requests initiated via
- // mime type sniffing, etc.
+ ssl_status, std::move(cloned_data),
+ info->IsDownload());
+ // Don't defer stream based or download requests. This includes requests
+ // initiated via mime type sniffing, etc.
// TODO(ananta)
// Make sure that the requests go through the throttle checks. Currently this
// does not work as the InterceptingResourceHandler is above us and hence it
// does not expect the old handler to defer the request.
- if (!info->is_stream())
+ if (!info->is_stream() && !info->IsDownload())
clamy 2016/11/25 10:46:00 I think we should call DetachFromCore if the reque
yzshen1 2016/11/28 22:03:59 In practice it won't cause trouble because before
*defer = true;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698