| 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/spdy/chromium/bidirectional_stream_spdy_impl.h" | 5 #include "net/spdy/chromium/bidirectional_stream_spdy_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 void Start(const BidirectionalStreamRequestInfo* request, | 133 void Start(const BidirectionalStreamRequestInfo* request, |
| 134 const NetLogWithSource& net_log) { | 134 const NetLogWithSource& net_log) { |
| 135 stream_->Start(request, net_log, | 135 stream_->Start(request, net_log, |
| 136 /*send_request_headers_automatically=*/false, this, | 136 /*send_request_headers_automatically=*/false, this, |
| 137 base::MakeUnique<base::Timer>(false, false)); | 137 base::MakeUnique<base::Timer>(false, false)); |
| 138 not_expect_callback_ = false; | 138 not_expect_callback_ = false; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void SendData(IOBuffer* data, int length, bool end_of_stream) { | 141 void SendData(IOBuffer* data, int length, bool end_of_stream) { |
| 142 not_expect_callback_ = true; | 142 SendvData({data}, {length}, end_of_stream); |
| 143 stream_->SendData(data, length, end_of_stream); | |
| 144 not_expect_callback_ = false; | |
| 145 } | 143 } |
| 146 | 144 |
| 147 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, | 145 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, |
| 148 const std::vector<int>& length, | 146 const std::vector<int>& length, |
| 149 bool end_of_stream) { | 147 bool end_of_stream) { |
| 150 not_expect_callback_ = true; | 148 not_expect_callback_ = true; |
| 151 stream_->SendvData(data, length, end_of_stream); | 149 stream_->SendvData(data, length, end_of_stream); |
| 152 not_expect_callback_ = false; | 150 not_expect_callback_ = false; |
| 153 } | 151 } |
| 154 | 152 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } else { | 510 } else { |
| 513 delegate->SendData(write_buffer.get(), write_buffer->size(), true); | 511 delegate->SendData(write_buffer.get(), write_buffer->size(), true); |
| 514 } | 512 } |
| 515 base::RunLoop().RunUntilIdle(); | 513 base::RunLoop().RunUntilIdle(); |
| 516 EXPECT_THAT(delegate->error(), IsError(ERR_UNEXPECTED)); | 514 EXPECT_THAT(delegate->error(), IsError(ERR_UNEXPECTED)); |
| 517 EXPECT_TRUE(delegate->on_failed_called()); | 515 EXPECT_TRUE(delegate->on_failed_called()); |
| 518 EXPECT_EQ(is_test_sendv ? 2 : 4, delegate->on_data_sent_count()); | 516 EXPECT_EQ(is_test_sendv ? 2 : 4, delegate->on_data_sent_count()); |
| 519 } | 517 } |
| 520 | 518 |
| 521 } // namespace net | 519 } // namespace net |
| OLD | NEW |