| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 CHECK_NE(OK, error); | 156 CHECK_NE(OK, error); |
| 157 | 157 |
| 158 on_failed_called_ = true; | 158 on_failed_called_ = true; |
| 159 error_ = error; | 159 error_ = error; |
| 160 loop_->Quit(); | 160 loop_->Quit(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void Start(const BidirectionalStreamRequestInfo* request_info, | 163 void Start(const BidirectionalStreamRequestInfo* request_info, |
| 164 const NetLogWithSource& net_log, | 164 const NetLogWithSource& net_log, |
| 165 std::unique_ptr<QuicChromiumClientSession::Handle> session) { | 165 std::unique_ptr<QuicChromiumClientSession::Handle> session) { |
| 166 not_expect_callback_ = true; |
| 166 stream_ = base::MakeUnique<BidirectionalStreamQuicImpl>(std::move(session)); | 167 stream_ = base::MakeUnique<BidirectionalStreamQuicImpl>(std::move(session)); |
| 167 stream_->Start(request_info, net_log, send_request_headers_automatically_, | 168 stream_->Start(request_info, net_log, send_request_headers_automatically_, |
| 168 this, nullptr); | 169 this, nullptr); |
| 170 not_expect_callback_ = false; |
| 169 } | 171 } |
| 170 | 172 |
| 171 void SendRequestHeaders() { stream_->SendRequestHeaders(); } | 173 void SendRequestHeaders() { |
| 174 not_expect_callback_ = true; |
| 175 stream_->SendRequestHeaders(); |
| 176 not_expect_callback_ = false; |
| 177 } |
| 172 | 178 |
| 173 void SendData(const scoped_refptr<IOBuffer>& data, | 179 void SendData(const scoped_refptr<IOBuffer>& data, |
| 174 int length, | 180 int length, |
| 175 bool end_of_stream) { | 181 bool end_of_stream) { |
| 176 SendvData({data}, {length}, end_of_stream); | 182 SendvData({data}, {length}, end_of_stream); |
| 177 } | 183 } |
| 178 | 184 |
| 179 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, | 185 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, |
| 180 const std::vector<int>& lengths, | 186 const std::vector<int>& lengths, |
| 181 bool end_of_stream) { | 187 bool end_of_stream) { |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 | 2116 |
| 2111 base::RunLoop().RunUntilIdle(); | 2117 base::RunLoop().RunUntilIdle(); |
| 2112 | 2118 |
| 2113 EXPECT_EQ(1, delegate->on_data_read_count()); | 2119 EXPECT_EQ(1, delegate->on_data_read_count()); |
| 2114 EXPECT_EQ(0, delegate->on_data_sent_count()); | 2120 EXPECT_EQ(0, delegate->on_data_sent_count()); |
| 2115 } | 2121 } |
| 2116 | 2122 |
| 2117 } // namespace test | 2123 } // namespace test |
| 2118 | 2124 |
| 2119 } // namespace net | 2125 } // namespace net |
| OLD | NEW |