Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: net/http/bidirectional_stream_impl.h

Issue 1992953004: [Cronet] Make delaying sending request headers explicit in bidirectional stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correct a typo Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/bidirectional_stream.cc ('k') | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/bidirectional_stream_impl.h
diff --git a/net/http/bidirectional_stream_impl.h b/net/http/bidirectional_stream_impl.h
index 8dff82df9c0df7778b577b003f9b6ed912eeec72..38cac64f03b3f3098394b76e855cf4d1956a51a5 100644
--- a/net/http/bidirectional_stream_impl.h
+++ b/net/http/bidirectional_stream_impl.h
@@ -43,7 +43,9 @@ class NET_EXPORT_PRIVATE BidirectionalStreamImpl {
// or call BidirectionalStreamImpl::Cancel to cancel the stream.
// The delegate should not call BidirectionalStreamImpl::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 response headers are received.
// This is called at most once for the lifetime of a stream.
@@ -90,12 +92,28 @@ class NET_EXPORT_PRIVATE BidirectionalStreamImpl {
virtual ~BidirectionalStreamImpl();
// Starts the BidirectionalStreamImpl and sends request headers.
+ // |send_request_headers_automatically| if true, request headers will be sent
+ // automatically when stream is negotiated. If false, request headers will be
+ // sent only when SendRequestHeaders() is invoked or with next
+ // SendData/SendvData.
virtual void Start(const BidirectionalStreamRequestInfo* request_info,
const BoundNetLog& net_log,
- bool disable_auto_flush,
+ bool send_request_headers_automatically,
BidirectionalStreamImpl::Delegate* delegate,
std::unique_ptr<base::Timer> timer) = 0;
+ // Sends request headers to server.
+ // When |send_request_headers_automatically_| is
+ // false and OnStreamReady() is invoked with request_headers_sent = false,
+ // headers will be combined with next SendData/SendvData unless this
+ // method is called first, in which case headers will be sent separately
+ // without delay.
+ // (This method cannot be called when |send_request_headers_automatically_| is
+ // true nor when OnStreamReady() is invoked with request_headers_sent = true,
+ // since headers have been sent by the stream when stream is negotiated
+ // successfully.)
+ virtual void SendRequestHeaders() = 0;
+
// Reads at most |buf_len| bytes into |buf|. Returns the number of bytes read,
// 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 read.
« no previous file with comments | « net/http/bidirectional_stream.cc ('k') | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698