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

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

Issue 625993002: Split up streams logic to prepare for PlzNavigate RDH changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: zork comments 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
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index a1cb1f1c15e8c7a0499e157d2e19c6ae16234193..d12314dc4c2ad3b77454efb8aa9b8769d596d6db 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -67,6 +67,7 @@
#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/resource_throttle.h"
#include "content/public/browser/stream_handle.h"
+#include "content/public/browser/stream_info.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
@@ -737,12 +738,16 @@ ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request,
origin));
info->set_is_stream(true);
- delegate_->OnStreamCreated(
- request,
- handler->stream()->CreateHandle(
- request->url(),
- mime_type,
- response->head.headers));
+ scoped_ptr<StreamInfo> stream_info(new StreamInfo);
+ stream_info->handle = handler->stream()->CreateHandle();
+ stream_info->original_url = request->url();
+ stream_info->mime_type = mime_type;
+ // Make a copy of the response headers so it is safe to pass across threads;
+ // the old handler (AsyncResourceHandler) may modify it in parallel via the
+ // ResourceDispatcherHostDelegate.
+ stream_info->response_headers =
+ new net::HttpResponseHeaders(response->head.headers->raw_headers());
+ delegate_->OnStreamCreated(request, stream_info.Pass());
return handler.PassAs<ResourceHandler>();
}

Powered by Google App Engine
This is Rietveld 408576698