| 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> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "net/quic/quic_alarm.h" | 12 #include "net/quic/quic_alarm.h" |
| 11 #include "net/quic/quic_client_promised_info.h" | 13 #include "net/quic/quic_client_promised_info.h" |
| 12 #include "net/quic/spdy_utils.h" | 14 #include "net/quic/spdy_utils.h" |
| 13 #include "net/spdy/spdy_protocol.h" | 15 #include "net/spdy/spdy_protocol.h" |
| 14 #include "net/tools/quic/quic_client_session.h" | 16 #include "net/tools/quic/quic_client_session.h" |
| 15 #include "net/tools/quic/spdy_balsa_utils.h" | 17 #include "net/tools/quic/spdy_balsa_utils.h" |
| 16 | 18 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 175 } |
| 174 MarkConsumed(iov.iov_len); | 176 MarkConsumed(iov.iov_len); |
| 175 } | 177 } |
| 176 if (sequencer()->IsClosed()) { | 178 if (sequencer()->IsClosed()) { |
| 177 OnFinRead(); | 179 OnFinRead(); |
| 178 } else { | 180 } else { |
| 179 sequencer()->SetUnblocked(); | 181 sequencer()->SetUnblocked(); |
| 180 } | 182 } |
| 181 } | 183 } |
| 182 | 184 |
| 183 size_t QuicSpdyClientStream::SendRequest(const SpdyHeaderBlock& headers, | 185 size_t QuicSpdyClientStream::SendRequest(SpdyHeaderBlock headers, |
| 184 StringPiece body, | 186 StringPiece body, |
| 185 bool fin) { | 187 bool fin) { |
| 186 bool send_fin_with_headers = fin && body.empty(); | 188 bool send_fin_with_headers = fin && body.empty(); |
| 187 size_t bytes_sent = body.size(); | 189 size_t bytes_sent = body.size(); |
| 188 header_bytes_written_ = WriteHeaders(headers, send_fin_with_headers, nullptr); | 190 header_bytes_written_ = |
| 191 WriteHeaders(std::move(headers), send_fin_with_headers, nullptr); |
| 189 bytes_sent += header_bytes_written_; | 192 bytes_sent += header_bytes_written_; |
| 190 | 193 |
| 191 if (!body.empty()) { | 194 if (!body.empty()) { |
| 192 WriteOrBufferData(body, fin, nullptr); | 195 WriteOrBufferData(body, fin, nullptr); |
| 193 } | 196 } |
| 194 | 197 |
| 195 return bytes_sent; | 198 return bytes_sent; |
| 196 } | 199 } |
| 197 | 200 |
| 198 } // namespace net | 201 } // namespace net |
| OLD | NEW |