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

Unified Diff: net/http/bidirectional_stream.cc

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.h ('k') | net/http/bidirectional_stream_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_));
}
« no previous file with comments | « net/http/bidirectional_stream.h ('k') | net/http/bidirectional_stream_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698