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

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

Issue 2549373004: PlzNavigate: Call NavigationHandle::WillProcessResponse for 204/205s (Closed)
Patch Set: Rebase + addressed comments 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
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 10a2f612ad4661842eadbae3f735d3a41ddf4fbf..37d8031ed26ba203a9c8707b5ff9f7f0106e2832 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(),
@@ -138,8 +128,16 @@ bool NavigationResourceHandler::OnResponseStarted(ResourceResponse* response,
// 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())
+ // TODO(clamy): We should also make the downloads wait on the
+ // NavigationThrottle checks be performed. Similarly to streams, it doesn't
+ // work because of the InterceptingResourceHandler.
+ // TODO(clamy): This NavigationResourceHandler should be split in two, with
+ // one part that wait on the NavigationThrottle to execute located between the
+ // MIME sniffing and the ResourceThrotlle, and one part that write the
+ // response to the stream being the leaf ResourceHandler.
+ if (!info->is_stream() && !info->IsDownload())
*defer = true;
+
return true;
}
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/test/test_navigation_url_loader_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698