| 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/bidirectional_stream_spdy_impl.h" | 5 #include "net/spdy/bidirectional_stream_spdy_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 CHECK(!on_failed_called_); | 125 CHECK(!on_failed_called_); |
| 126 CHECK(!not_expect_callback_); | 126 CHECK(!not_expect_callback_); |
| 127 CHECK_NE(OK, error); | 127 CHECK_NE(OK, error); |
| 128 error_ = error; | 128 error_ = error; |
| 129 on_failed_called_ = true; | 129 on_failed_called_ = true; |
| 130 if (run_until_completion_) | 130 if (run_until_completion_) |
| 131 loop_->Quit(); | 131 loop_->Quit(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void Start(const BidirectionalStreamRequestInfo* request, | 134 void Start(const BidirectionalStreamRequestInfo* request, |
| 135 const BoundNetLog& net_log) { | 135 const NetLogWithSource& net_log) { |
| 136 stream_->Start(request, net_log, | 136 stream_->Start(request, net_log, |
| 137 /*send_request_headers_automatically=*/false, this, | 137 /*send_request_headers_automatically=*/false, this, |
| 138 base::MakeUnique<base::Timer>(false, false)); | 138 base::MakeUnique<base::Timer>(false, false)); |
| 139 not_expect_callback_ = false; | 139 not_expect_callback_ = false; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void SendData(IOBuffer* data, int length, bool end_of_stream) { | 142 void SendData(IOBuffer* data, int length, bool end_of_stream) { |
| 143 not_expect_callback_ = true; | 143 not_expect_callback_ = true; |
| 144 stream_->SendData(data, length, end_of_stream); | 144 stream_->SendData(data, length, end_of_stream); |
| 145 not_expect_callback_ = false; | 145 not_expect_callback_ = false; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 EXPECT_EQ(0, delegate->on_data_sent_count()); | 426 EXPECT_EQ(0, delegate->on_data_sent_count()); |
| 427 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol()); | 427 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol()); |
| 428 // BidirectionalStreamSpdyStreamJob does not count the bytes sent for |rst| | 428 // BidirectionalStreamSpdyStreamJob does not count the bytes sent for |rst| |
| 429 // because it is sent after SpdyStream::Delegate::OnClose is called. | 429 // because it is sent after SpdyStream::Delegate::OnClose is called. |
| 430 EXPECT_EQ(CountWriteBytes(writes, 1), delegate->GetTotalSentBytes()); | 430 EXPECT_EQ(CountWriteBytes(writes, 1), delegate->GetTotalSentBytes()); |
| 431 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), | 431 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), |
| 432 delegate->GetTotalReceivedBytes()); | 432 delegate->GetTotalReceivedBytes()); |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace net | 435 } // namespace net |
| OLD | NEW |