| Index: net/http/bidirectional_stream.h
|
| diff --git a/net/http/bidirectional_stream.h b/net/http/bidirectional_stream.h
|
| index 86b3fff2d77180b8bde33c1a2f4df84b7aab47db..4fda62efb63d7d0cff95c0c9c09e5b7106bfe045 100644
|
| --- a/net/http/bidirectional_stream.h
|
| +++ b/net/http/bidirectional_stream.h
|
| @@ -50,7 +50,9 @@ class NET_EXPORT BidirectionalStream
|
| // or call BidirectionalStream::SendData to send data.
|
| // The delegate should not call BidirectionalStream::Cancel
|
| // during this callback.
|
| - virtual void OnStreamReady() = 0;
|
| + // |request_headers_sent| if true, request headers have been sent. If false,
|
| + // SendRequestHeaders() needs to be explicitly called.
|
| + virtual void OnStreamReady(bool request_headers_sent) = 0;
|
|
|
| // Called when headers are received. This is called at most once for the
|
| // lifetime of a stream.
|
| @@ -94,10 +96,14 @@ class NET_EXPORT BidirectionalStream
|
| // the request, and must be non-NULL. |session| is the http network session
|
| // with which this request will be made. |delegate| must be non-NULL.
|
| // |session| and |delegate| must outlive |this|.
|
| + // |send_request_headers_automatically| if true, request headers will be sent
|
| + // automatically when stream is negotiated. If false, request headers will be
|
| + // sent only if until SendRequestHeaders() is invoked or until next
|
| + // SendData/SendvData.
|
| BidirectionalStream(
|
| std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
|
| HttpNetworkSession* session,
|
| - bool disable_auto_flush,
|
| + bool send_request_headers_automatically,
|
| Delegate* delegate);
|
|
|
| // Constructor that accepts a Timer, which can be used in tests to control
|
| @@ -105,7 +111,7 @@ class NET_EXPORT 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);
|
|
|
| @@ -114,6 +120,12 @@ class NET_EXPORT BidirectionalStream
|
| // Delegate::OnDataSent.
|
| ~BidirectionalStream() override;
|
|
|
| + // Sends request headers to server. This is only required when
|
| + // |send_request_headers_automatically| is false.
|
| + // If |send_request_headers_automatically| is true, headers will be sent
|
| + // automatically by the stream when stream is negotiated successfully.
|
| + void SendRequestHeaders();
|
| +
|
| // Reads at most |buf_len| bytes into |buf|. Returns the number of bytes read,
|
| // or ERR_IO_PENDING if the read is to be completed asynchronously, or an
|
| // error code if any error occurred. If returns 0, there is no more data to
|
| @@ -161,7 +173,7 @@ class NET_EXPORT BidirectionalStream
|
|
|
| private:
|
| // BidirectionalStreamImpl::Delegate implementation:
|
| - void OnStreamReady() override;
|
| + void OnStreamReady(bool request_headers_sent) override;
|
| void OnHeadersReceived(const SpdyHeaderBlock& response_headers) override;
|
| void OnDataRead(int bytes_read) override;
|
| void OnDataSent() override;
|
| @@ -204,7 +216,7 @@ class NET_EXPORT BidirectionalStream
|
|
|
| HttpNetworkSession* session_;
|
|
|
| - bool disable_auto_flush_;
|
| + bool send_request_headers_automatically_;
|
| Delegate* const delegate_;
|
|
|
| // Timer used to buffer data received in short time-spans and send a single
|
|
|