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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 SpdyHeaderBlock promise_headers; | 132 SpdyHeaderBlock promise_headers; |
133 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length, | 133 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length, |
134 &promise_headers)) { | 134 &promise_headers)) { |
135 DLOG(ERROR) << "Failed to parse promise headers: " | 135 DLOG(ERROR) << "Failed to parse promise headers: " |
136 << header_list.DebugString(); | 136 << header_list.DebugString(); |
137 Reset(QUIC_BAD_APPLICATION_PAYLOAD); | 137 Reset(QUIC_BAD_APPLICATION_PAYLOAD); |
138 return; | 138 return; |
139 } | 139 } |
140 | 140 |
141 session_->HandlePromised(id(), promised_id, promise_headers); | 141 session_->HandlePromised(id(), promised_id, promise_headers); |
| 142 if (visitor() != nullptr) { |
| 143 visitor()->OnPromiseHeadersComplete(promised_id, frame_len); |
| 144 } |
142 } | 145 } |
143 | 146 |
144 void QuicSpdyClientStream::OnDataAvailable() { | 147 void QuicSpdyClientStream::OnDataAvailable() { |
145 if (FLAGS_quic_supports_push_promise) { | 148 if (FLAGS_quic_supports_push_promise) { |
146 // For push streams, visitor will not be set until the rendezvous | 149 // For push streams, visitor will not be set until the rendezvous |
147 // between server promise and client request is complete. | 150 // between server promise and client request is complete. |
148 if (visitor() == nullptr) | 151 if (visitor() == nullptr) |
149 return; | 152 return; |
150 } | 153 } |
151 | 154 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 bytes_sent += header_bytes_written_; | 187 bytes_sent += header_bytes_written_; |
185 | 188 |
186 if (!body.empty()) { | 189 if (!body.empty()) { |
187 WriteOrBufferData(body, fin, nullptr); | 190 WriteOrBufferData(body, fin, nullptr); |
188 } | 191 } |
189 | 192 |
190 return bytes_sent; | 193 return bytes_sent; |
191 } | 194 } |
192 | 195 |
193 } // namespace net | 196 } // namespace net |
OLD | NEW |