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

Unified Diff: net/http/bidirectional_stream.cc

Issue 1817583002: Process Alternative Service headers in net::BidirectionalStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@toggle2
Patch Set: Address comments and rebased Created 4 years, 9 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 | « net/http/bidirectional_stream.h ('k') | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/bidirectional_stream.cc
diff --git a/net/http/bidirectional_stream.cc b/net/http/bidirectional_stream.cc
index cacb08478a0c559a767fe1803449d5675121fd4d..d9b04e06bc5b628069987bafbc16709efdd0c976 100644
--- a/net/http/bidirectional_stream.cc
+++ b/net/http/bidirectional_stream.cc
@@ -15,7 +15,9 @@
#include "net/base/net_errors.h"
#include "net/http/bidirectional_stream_request_info.h"
#include "net/http/http_network_session.h"
+#include "net/http/http_response_headers.h"
#include "net/http/http_stream.h"
+#include "net/spdy/spdy_http_utils.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_config.h"
#include "url/gurl.h"
@@ -43,6 +45,7 @@ BidirectionalStream::BidirectionalStream(
: request_info_(std::move(request_info)),
net_log_(BoundNetLog::Make(session->net_log(),
NetLog::SOURCE_BIDIRECTIONAL_STREAM)),
+ session_(session),
delegate_(delegate),
timer_(std::move(timer)) {
DCHECK(delegate_);
@@ -129,6 +132,16 @@ void BidirectionalStream::OnHeadersSent() {
void BidirectionalStream::OnHeadersReceived(
const SpdyHeaderBlock& response_headers) {
+ HttpResponseInfo response_info;
+ if (!SpdyHeadersToHttpResponse(response_headers, HTTP2, &response_info)) {
+ DLOG(WARNING) << "Invalid headers";
+ delegate_->OnFailed(ERR_FAILED);
+ return;
+ }
+
+ session_->http_stream_factory()->ProcessAlternativeServices(
+ session_, response_info.headers.get(),
+ HostPortPair::FromURL(request_info_->url));
delegate_->OnHeadersReceived(response_headers);
}
« no previous file with comments | « net/http/bidirectional_stream.h ('k') | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698