OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tools/quic/quic_spdy_client_stream.h" | 5 #include "net/tools/quic/quic_spdy_client_stream.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 DVLOG(1) << "headers complete for stream " << id(); | 96 DVLOG(1) << "headers complete for stream " << id(); |
97 | 97 |
98 session_->OnInitialHeadersComplete(id(), response_headers_); | 98 session_->OnInitialHeadersComplete(id(), response_headers_); |
99 } | 99 } |
100 | 100 |
101 void QuicSpdyClientStream::OnTrailingHeadersComplete( | 101 void QuicSpdyClientStream::OnTrailingHeadersComplete( |
102 bool fin, | 102 bool fin, |
103 size_t frame_len, | 103 size_t frame_len, |
104 const QuicHeaderList& header_list) { | 104 const QuicHeaderList& header_list) { |
105 QuicSpdyStream::OnTrailingHeadersComplete(fin, frame_len, header_list); | 105 QuicSpdyStream::OnTrailingHeadersComplete(fin, frame_len, header_list); |
106 MarkTrailersConsumed(decompressed_trailers().length()); | 106 MarkTrailersConsumed(); |
107 } | 107 } |
108 | 108 |
109 void QuicSpdyClientStream::OnPromiseHeadersComplete(QuicStreamId promised_id, | 109 void QuicSpdyClientStream::OnPromiseHeadersComplete(QuicStreamId promised_id, |
110 size_t frame_len) { | 110 size_t frame_len) { |
111 header_bytes_read_ += frame_len; | 111 header_bytes_read_ += frame_len; |
112 int64_t content_length = -1; | 112 int64_t content_length = -1; |
113 SpdyHeaderBlock promise_headers; | 113 SpdyHeaderBlock promise_headers; |
114 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(), | 114 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(), |
115 decompressed_headers().length(), &content_length, | 115 decompressed_headers().length(), &content_length, |
116 &promise_headers)) { | 116 &promise_headers)) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 bytes_sent += header_bytes_written_; | 190 bytes_sent += header_bytes_written_; |
191 | 191 |
192 if (!body.empty()) { | 192 if (!body.empty()) { |
193 WriteOrBufferData(body, fin, nullptr); | 193 WriteOrBufferData(body, fin, nullptr); |
194 } | 194 } |
195 | 195 |
196 return bytes_sent; | 196 return bytes_sent; |
197 } | 197 } |
198 | 198 |
199 } // namespace net | 199 } // namespace net |
OLD | NEW |