| 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/quic/chromium/quic_chromium_client_stream.h" | 5 #include "net/quic/chromium/quic_chromium_client_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 QuicStream::OnCanWrite(); | 116 QuicStream::OnCanWrite(); |
| 117 | 117 |
| 118 if (!HasBufferedData() && !callback_.is_null()) { | 118 if (!HasBufferedData() && !callback_.is_null()) { |
| 119 base::ResetAndReturn(&callback_).Run(OK); | 119 base::ResetAndReturn(&callback_).Run(OK); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 size_t QuicChromiumClientStream::WriteHeaders( | 123 size_t QuicChromiumClientStream::WriteHeaders( |
| 124 SpdyHeaderBlock header_block, | 124 SpdyHeaderBlock header_block, |
| 125 bool fin, | 125 bool fin, |
| 126 const scoped_refptr<QuicAckListenerInterface>& ack_notifier_delegate) { | 126 scoped_refptr<QuicAckListenerInterface> ack_notifier_delegate) { |
| 127 if (!session()->IsCryptoHandshakeConfirmed()) { | 127 if (!session()->IsCryptoHandshakeConfirmed()) { |
| 128 auto entry = header_block.find(":method"); | 128 auto entry = header_block.find(":method"); |
| 129 DCHECK(entry != header_block.end()); | 129 DCHECK(entry != header_block.end()); |
| 130 DCHECK_NE("POST", entry->second); | 130 DCHECK_NE("POST", entry->second); |
| 131 } | 131 } |
| 132 net_log_.AddEvent( | 132 net_log_.AddEvent( |
| 133 NetLogEventType::QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS, | 133 NetLogEventType::QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS, |
| 134 base::Bind(&QuicRequestNetLogCallback, id(), &header_block, | 134 base::Bind(&QuicRequestNetLogCallback, id(), &header_block, |
| 135 QuicSpdyStream::priority())); | 135 QuicSpdyStream::priority())); |
| 136 return QuicSpdyStream::WriteHeaders(std::move(header_block), fin, | 136 return QuicSpdyStream::WriteHeaders(std::move(header_block), fin, |
| 137 ack_notifier_delegate); | 137 std::move(ack_notifier_delegate)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 SpdyPriority QuicChromiumClientStream::priority() const { | 140 SpdyPriority QuicChromiumClientStream::priority() const { |
| 141 if (delegate_ && delegate_->HasSendHeadersComplete()) { | 141 if (delegate_ && delegate_->HasSendHeadersComplete()) { |
| 142 return QuicSpdyStream::priority(); | 142 return QuicSpdyStream::priority(); |
| 143 } | 143 } |
| 144 return net::kV3HighestPriority; | 144 return net::kV3HighestPriority; |
| 145 } | 145 } |
| 146 | 146 |
| 147 int QuicChromiumClientStream::WriteStreamData( | 147 int QuicChromiumClientStream::WriteStreamData( |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 void QuicChromiumClientStream::DisableConnectionMigration() { | 285 void QuicChromiumClientStream::DisableConnectionMigration() { |
| 286 can_migrate_ = false; | 286 can_migrate_ = false; |
| 287 } | 287 } |
| 288 | 288 |
| 289 bool QuicChromiumClientStream::IsFirstStream() { | 289 bool QuicChromiumClientStream::IsFirstStream() { |
| 290 return id() == kHeadersStreamId + 2; | 290 return id() == kHeadersStreamId + 2; |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace net | 293 } // namespace net |
| OLD | NEW |