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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "net/quic/quic_alarm.h" | 10 #include "net/quic/quic_alarm.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 decompressed_headers().length(), &content_length, | 111 decompressed_headers().length(), &content_length, |
112 &promise_headers)) { | 112 &promise_headers)) { |
113 DLOG(ERROR) << "Failed to parse promise headers: " | 113 DLOG(ERROR) << "Failed to parse promise headers: " |
114 << decompressed_headers(); | 114 << decompressed_headers(); |
115 Reset(QUIC_BAD_APPLICATION_PAYLOAD); | 115 Reset(QUIC_BAD_APPLICATION_PAYLOAD); |
116 return; | 116 return; |
117 } | 117 } |
118 MarkHeadersConsumed(decompressed_headers().length()); | 118 MarkHeadersConsumed(decompressed_headers().length()); |
119 | 119 |
120 session_->HandlePromised(id(), promised_id, promise_headers); | 120 session_->HandlePromised(id(), promised_id, promise_headers); |
| 121 if (visitor() != nullptr) { |
| 122 visitor()->OnPromiseHeadersComplete(promised_id, frame_len); |
| 123 } |
121 } | 124 } |
122 | 125 |
123 void QuicSpdyClientStream::OnPromiseHeaderList( | 126 void QuicSpdyClientStream::OnPromiseHeaderList( |
124 QuicStreamId promised_id, | 127 QuicStreamId promised_id, |
125 size_t frame_len, | 128 size_t frame_len, |
126 const QuicHeaderList& header_list) { | 129 const QuicHeaderList& header_list) { |
127 header_bytes_read_ += frame_len; | 130 header_bytes_read_ += frame_len; |
128 int64_t content_length = -1; | 131 int64_t content_length = -1; |
129 SpdyHeaderBlock promise_headers; | 132 SpdyHeaderBlock promise_headers; |
130 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length, | 133 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 bytes_sent += header_bytes_written_; | 184 bytes_sent += header_bytes_written_; |
182 | 185 |
183 if (!body.empty()) { | 186 if (!body.empty()) { |
184 WriteOrBufferData(body, fin, nullptr); | 187 WriteOrBufferData(body, fin, nullptr); |
185 } | 188 } |
186 | 189 |
187 return bytes_sent; | 190 return bytes_sent; |
188 } | 191 } |
189 | 192 |
190 } // namespace net | 193 } // namespace net |
OLD | NEW |