OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/bidirectional_stream.h" | 5 #include "net/http/bidirectional_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 net_log_.AddEvent( | 228 net_log_.AddEvent( |
229 NetLog::TYPE_BIDIRECTIONAL_STREAM_READY, | 229 NetLog::TYPE_BIDIRECTIONAL_STREAM_READY, |
230 NetLog::BoolCallback("request_headers_sent", request_headers_sent)); | 230 NetLog::BoolCallback("request_headers_sent", request_headers_sent)); |
231 } | 231 } |
232 delegate_->OnStreamReady(request_headers_sent); | 232 delegate_->OnStreamReady(request_headers_sent); |
233 } | 233 } |
234 | 234 |
235 void BidirectionalStream::OnHeadersReceived( | 235 void BidirectionalStream::OnHeadersReceived( |
236 const SpdyHeaderBlock& response_headers) { | 236 const SpdyHeaderBlock& response_headers) { |
237 HttpResponseInfo response_info; | 237 HttpResponseInfo response_info; |
238 if (!SpdyHeadersToHttpResponse(response_headers, HTTP2, &response_info)) { | 238 if (!SpdyHeadersToHttpResponse(response_headers, &response_info)) { |
239 DLOG(WARNING) << "Invalid headers"; | 239 DLOG(WARNING) << "Invalid headers"; |
240 NotifyFailed(ERR_FAILED); | 240 NotifyFailed(ERR_FAILED); |
241 return; | 241 return; |
242 } | 242 } |
243 if (net_log_.IsCapturing()) { | 243 if (net_log_.IsCapturing()) { |
244 net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS, | 244 net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS, |
245 base::Bind(&NetLogHeadersCallback, &response_headers)); | 245 base::Bind(&NetLogHeadersCallback, &response_headers)); |
246 } | 246 } |
247 session_->http_stream_factory()->ProcessAlternativeServices( | 247 session_->http_stream_factory()->ProcessAlternativeServices( |
248 session_, response_info.headers.get(), | 248 session_, response_info.headers.get(), |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 NotifyFailed(ERR_HTTPS_PROXY_TUNNEL_RESPONSE); | 375 NotifyFailed(ERR_HTTPS_PROXY_TUNNEL_RESPONSE); |
376 } | 376 } |
377 | 377 |
378 void BidirectionalStream::OnQuicBroken() {} | 378 void BidirectionalStream::OnQuicBroken() {} |
379 | 379 |
380 void BidirectionalStream::NotifyFailed(int error) { | 380 void BidirectionalStream::NotifyFailed(int error) { |
381 delegate_->OnFailed(error); | 381 delegate_->OnFailed(error); |
382 } | 382 } |
383 | 383 |
384 } // namespace net | 384 } // namespace net |
OLD | NEW |