| 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/quic_chromium_client_stream.h" | 5 #include "net/quic/quic_chromium_client_stream.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 if (!HasBufferedData() && !callback_.is_null()) { | 133 if (!HasBufferedData() && !callback_.is_null()) { |
| 134 base::ResetAndReturn(&callback_).Run(OK); | 134 base::ResetAndReturn(&callback_).Run(OK); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 size_t QuicChromiumClientStream::WriteHeaders( | 138 size_t QuicChromiumClientStream::WriteHeaders( |
| 139 const SpdyHeaderBlock& header_block, | 139 const SpdyHeaderBlock& header_block, |
| 140 bool fin, | 140 bool fin, |
| 141 QuicAckListenerInterface* ack_notifier_delegate) { | 141 QuicAckListenerInterface* ack_notifier_delegate) { |
| 142 if (!session()->IsCryptoHandshakeConfirmed()) { |
| 143 auto entry = header_block.find(":method"); |
| 144 DCHECK(entry != header_block.end()); |
| 145 DCHECK_NE("POST", entry->second); |
| 146 } |
| 142 net_log_.AddEvent( | 147 net_log_.AddEvent( |
| 143 NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS, | 148 NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS, |
| 144 base::Bind(&QuicRequestNetLogCallback, id(), &header_block, | 149 base::Bind(&QuicRequestNetLogCallback, id(), &header_block, |
| 145 QuicSpdyStream::priority())); | 150 QuicSpdyStream::priority())); |
| 146 return QuicSpdyStream::WriteHeaders(header_block, fin, ack_notifier_delegate); | 151 return QuicSpdyStream::WriteHeaders(header_block, fin, ack_notifier_delegate); |
| 147 } | 152 } |
| 148 | 153 |
| 149 SpdyPriority QuicChromiumClientStream::priority() const { | 154 SpdyPriority QuicChromiumClientStream::priority() const { |
| 150 if (delegate_ && delegate_->HasSendHeadersComplete()) { | 155 if (delegate_ && delegate_->HasSendHeadersComplete()) { |
| 151 return QuicSpdyStream::priority(); | 156 return QuicSpdyStream::priority(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } else { | 288 } else { |
| 284 delegate_tasks_.push_back(closure); | 289 delegate_tasks_.push_back(closure); |
| 285 } | 290 } |
| 286 } | 291 } |
| 287 | 292 |
| 288 void QuicChromiumClientStream::DisableConnectionMigration() { | 293 void QuicChromiumClientStream::DisableConnectionMigration() { |
| 289 can_migrate_ = false; | 294 can_migrate_ = false; |
| 290 } | 295 } |
| 291 | 296 |
| 292 } // namespace net | 297 } // namespace net |
| OLD | NEW |