| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bidirectional_stream_quic_impl.h" | 5 #include "net/quic/chromium/bidirectional_stream_quic_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 stream_ = base::MakeUnique<BidirectionalStreamQuicImpl>(std::move(session)); | 166 stream_ = base::MakeUnique<BidirectionalStreamQuicImpl>(std::move(session)); |
| 167 stream_->Start(request_info, net_log, send_request_headers_automatically_, | 167 stream_->Start(request_info, net_log, send_request_headers_automatically_, |
| 168 this, nullptr); | 168 this, nullptr); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void SendRequestHeaders() { stream_->SendRequestHeaders(); } | 171 void SendRequestHeaders() { stream_->SendRequestHeaders(); } |
| 172 | 172 |
| 173 void SendData(const scoped_refptr<IOBuffer>& data, | 173 void SendData(const scoped_refptr<IOBuffer>& data, |
| 174 int length, | 174 int length, |
| 175 bool end_of_stream) { | 175 bool end_of_stream) { |
| 176 not_expect_callback_ = true; | 176 SendvData({data}, {length}, end_of_stream); |
| 177 stream_->SendData(data, length, end_of_stream); | |
| 178 not_expect_callback_ = false; | |
| 179 } | 177 } |
| 180 | 178 |
| 181 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, | 179 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, |
| 182 const std::vector<int>& lengths, | 180 const std::vector<int>& lengths, |
| 183 bool end_of_stream) { | 181 bool end_of_stream) { |
| 184 not_expect_callback_ = true; | 182 not_expect_callback_ = true; |
| 185 stream_->SendvData(data, lengths, end_of_stream); | 183 stream_->SendvData(data, lengths, end_of_stream); |
| 186 not_expect_callback_ = false; | 184 not_expect_callback_ = false; |
| 187 } | 185 } |
| 188 | 186 |
| (...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 | 2110 |
| 2113 base::RunLoop().RunUntilIdle(); | 2111 base::RunLoop().RunUntilIdle(); |
| 2114 | 2112 |
| 2115 EXPECT_EQ(1, delegate->on_data_read_count()); | 2113 EXPECT_EQ(1, delegate->on_data_read_count()); |
| 2116 EXPECT_EQ(0, delegate->on_data_sent_count()); | 2114 EXPECT_EQ(0, delegate->on_data_sent_count()); |
| 2117 } | 2115 } |
| 2118 | 2116 |
| 2119 } // namespace test | 2117 } // namespace test |
| 2120 | 2118 |
| 2121 } // namespace net | 2119 } // namespace net |
| OLD | NEW |