| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 decompressed_headers().length(), &content_length, | 83 decompressed_headers().length(), &content_length, |
| 84 &promise_headers)) { | 84 &promise_headers)) { |
| 85 DLOG(ERROR) << "Failed to parse promise headers: " | 85 DLOG(ERROR) << "Failed to parse promise headers: " |
| 86 << decompressed_headers(); | 86 << decompressed_headers(); |
| 87 Reset(QUIC_BAD_APPLICATION_PAYLOAD); | 87 Reset(QUIC_BAD_APPLICATION_PAYLOAD); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 MarkHeadersConsumed(decompressed_headers().length()); | 90 MarkHeadersConsumed(decompressed_headers().length()); |
| 91 | 91 |
| 92 session_->HandlePromised(id(), promised_id, promise_headers); | 92 session_->HandlePromised(id(), promised_id, promise_headers); |
| 93 if (visitor() != nullptr) { |
| 94 visitor()->OnPromiseHeadersComplete(promised_id, frame_len); |
| 95 } |
| 93 } | 96 } |
| 94 | 97 |
| 95 void QuicSpdyClientStream::OnDataAvailable() { | 98 void QuicSpdyClientStream::OnDataAvailable() { |
| 96 if (FLAGS_quic_supports_push_promise) { | 99 if (FLAGS_quic_supports_push_promise) { |
| 97 // For push streams, visitor will not be set until the rendezvous | 100 // For push streams, visitor will not be set until the rendezvous |
| 98 // between server promise and client request is complete. | 101 // between server promise and client request is complete. |
| 99 if (visitor() == nullptr) | 102 if (visitor() == nullptr) |
| 100 return; | 103 return; |
| 101 } | 104 } |
| 102 | 105 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 bytes_sent += header_bytes_written_; | 138 bytes_sent += header_bytes_written_; |
| 136 | 139 |
| 137 if (!body.empty()) { | 140 if (!body.empty()) { |
| 138 WriteOrBufferData(body, fin, nullptr); | 141 WriteOrBufferData(body, fin, nullptr); |
| 139 } | 142 } |
| 140 | 143 |
| 141 return bytes_sent; | 144 return bytes_sent; |
| 142 } | 145 } |
| 143 | 146 |
| 144 } // namespace net | 147 } // namespace net |
| OLD | NEW |