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/spdy/spdy_stream_test_util.h" | 5 #include "net/spdy/spdy_stream_test_util.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 buf_(new StringIOBuffer(data.as_string())) {} | 134 buf_(new StringIOBuffer(data.as_string())) {} |
135 | 135 |
136 StreamDelegateWithBody::~StreamDelegateWithBody() { | 136 StreamDelegateWithBody::~StreamDelegateWithBody() { |
137 } | 137 } |
138 | 138 |
139 void StreamDelegateWithBody::OnRequestHeadersSent() { | 139 void StreamDelegateWithBody::OnRequestHeadersSent() { |
140 StreamDelegateBase::OnRequestHeadersSent(); | 140 StreamDelegateBase::OnRequestHeadersSent(); |
141 stream()->SendData(buf_.get(), buf_->size(), NO_MORE_DATA_TO_SEND); | 141 stream()->SendData(buf_.get(), buf_->size(), NO_MORE_DATA_TO_SEND); |
142 } | 142 } |
143 | 143 |
| 144 StreamDelegateCloseOnHeaders::StreamDelegateCloseOnHeaders( |
| 145 const base::WeakPtr<SpdyStream>& stream) |
| 146 : StreamDelegateBase(stream) { |
| 147 } |
| 148 |
| 149 StreamDelegateCloseOnHeaders::~StreamDelegateCloseOnHeaders() { |
| 150 } |
| 151 |
| 152 SpdyResponseHeadersStatus |
| 153 StreamDelegateCloseOnHeaders::OnResponseHeadersUpdated( |
| 154 const SpdyHeaderBlock& response_headers) { |
| 155 stream()->Cancel(); |
| 156 return RESPONSE_HEADERS_ARE_COMPLETE; |
| 157 } |
| 158 |
144 } // namespace test | 159 } // namespace test |
145 | 160 |
146 } // namespace net | 161 } // namespace net |
OLD | NEW |