| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/quic/bidirectional_stream_quic_impl.h" | 5 #include "net/quic/bidirectional_stream_quic_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); | 87 weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 SpdyHeaderBlock headers; | 91 SpdyHeaderBlock headers; |
| 92 HttpRequestInfo http_request_info; | 92 HttpRequestInfo http_request_info; |
| 93 http_request_info.url = request_info_->url; | 93 http_request_info.url = request_info_->url; |
| 94 http_request_info.method = request_info_->method; | 94 http_request_info.method = request_info_->method; |
| 95 http_request_info.extra_headers = request_info_->extra_headers; | 95 http_request_info.extra_headers = request_info_->extra_headers; |
| 96 | 96 |
| 97 CreateSpdyHeadersFromHttpRequest(http_request_info, | 97 CreateSpdyHeadersFromHttpRequest( |
| 98 http_request_info.extra_headers, HTTP2, true, | 98 http_request_info, http_request_info.extra_headers, true, &headers); |
| 99 &headers); | |
| 100 size_t headers_bytes_sent = stream_->WriteHeaders( | 99 size_t headers_bytes_sent = stream_->WriteHeaders( |
| 101 std::move(headers), request_info_->end_stream_on_headers, nullptr); | 100 std::move(headers), request_info_->end_stream_on_headers, nullptr); |
| 102 headers_bytes_sent_ += headers_bytes_sent; | 101 headers_bytes_sent_ += headers_bytes_sent; |
| 103 has_sent_headers_ = true; | 102 has_sent_headers_ = true; |
| 104 } | 103 } |
| 105 | 104 |
| 106 int BidirectionalStreamQuicImpl::ReadData(IOBuffer* buffer, int buffer_len) { | 105 int BidirectionalStreamQuicImpl::ReadData(IOBuffer* buffer, int buffer_len) { |
| 107 DCHECK(buffer); | 106 DCHECK(buffer); |
| 108 DCHECK(buffer_len); | 107 DCHECK(buffer_len); |
| 109 | 108 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void BidirectionalStreamQuicImpl::ResetStream() { | 347 void BidirectionalStreamQuicImpl::ResetStream() { |
| 349 if (!stream_) | 348 if (!stream_) |
| 350 return; | 349 return; |
| 351 closed_stream_received_bytes_ = stream_->stream_bytes_read(); | 350 closed_stream_received_bytes_ = stream_->stream_bytes_read(); |
| 352 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 351 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
| 353 stream_->SetDelegate(nullptr); | 352 stream_->SetDelegate(nullptr); |
| 354 stream_ = nullptr; | 353 stream_ = nullptr; |
| 355 } | 354 } |
| 356 | 355 |
| 357 } // namespace net | 356 } // namespace net |
| OLD | NEW |