| Index: net/http/bidirectional_stream.cc
|
| diff --git a/net/http/bidirectional_stream.cc b/net/http/bidirectional_stream.cc
|
| index 8b83c1e93515f06efaa4db3b5aaca903b35ec1ca..0c0945142e415d8cbcdf68d4cb4c06141bc76e98 100644
|
| --- a/net/http/bidirectional_stream.cc
|
| +++ b/net/http/bidirectional_stream.cc
|
| @@ -59,32 +59,31 @@ std::unique_ptr<base::Value> NetLogCallback(const GURL* url,
|
|
|
| BidirectionalStream::Delegate::Delegate() {}
|
|
|
| -void BidirectionalStream::Delegate::OnStreamReady() {}
|
| -
|
| BidirectionalStream::Delegate::~Delegate() {}
|
|
|
| BidirectionalStream::BidirectionalStream(
|
| std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
|
| HttpNetworkSession* session,
|
| - bool disable_auto_flush,
|
| + bool send_request_headers_automatically,
|
| Delegate* delegate)
|
| : BidirectionalStream(std::move(request_info),
|
| session,
|
| - disable_auto_flush,
|
| + send_request_headers_automatically,
|
| delegate,
|
| base::WrapUnique(new base::Timer(false, false))) {}
|
|
|
| BidirectionalStream::BidirectionalStream(
|
| std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
|
| HttpNetworkSession* session,
|
| - bool disable_auto_flush,
|
| + bool send_request_headers_automatically,
|
| Delegate* delegate,
|
| std::unique_ptr<base::Timer> timer)
|
| : request_info_(std::move(request_info)),
|
| net_log_(BoundNetLog::Make(session->net_log(),
|
| NetLog::SOURCE_BIDIRECTIONAL_STREAM)),
|
| session_(session),
|
| - disable_auto_flush_(disable_auto_flush),
|
| + send_request_headers_automatically_(send_request_headers_automatically),
|
| + request_headers_sent_(false),
|
| delegate_(delegate),
|
| timer_(std::move(timer)) {
|
| DCHECK(delegate_);
|
| @@ -131,6 +130,14 @@ BidirectionalStream::~BidirectionalStream() {
|
| }
|
| }
|
|
|
| +void BidirectionalStream::SendRequestHeaders() {
|
| + DCHECK(stream_impl_);
|
| + DCHECK(!request_headers_sent_);
|
| + DCHECK(!send_request_headers_automatically_);
|
| +
|
| + stream_impl_->SendRequestHeaders();
|
| +}
|
| +
|
| int BidirectionalStream::ReadData(IOBuffer* buf, int buf_len) {
|
| DCHECK(stream_impl_);
|
|
|
| @@ -202,8 +209,9 @@ int64_t BidirectionalStream::GetTotalSentBytes() const {
|
| return stream_impl_->GetTotalSentBytes();
|
| }
|
|
|
| -void BidirectionalStream::OnStreamReady() {
|
| - delegate_->OnStreamReady();
|
| +void BidirectionalStream::OnStreamReady(bool request_headers_sent) {
|
| + request_headers_sent_ = request_headers_sent;
|
| + delegate_->OnStreamReady(request_headers_sent);
|
| }
|
|
|
| void BidirectionalStream::OnHeadersReceived(
|
| @@ -278,7 +286,8 @@ void BidirectionalStream::OnBidirectionalStreamImplReady(
|
|
|
| stream_request_.reset();
|
| stream_impl_.reset(stream);
|
| - stream_impl_->Start(request_info_.get(), net_log_, disable_auto_flush_, this,
|
| + stream_impl_->Start(request_info_.get(), net_log_,
|
| + send_request_headers_automatically_, this,
|
| std::move(timer_));
|
| }
|
|
|
|
|