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

Unified Diff: net/quic/quic_http_stream.cc

Issue 110853010: Enable support for QUIC 13. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android Created 7 years 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/net.gyp ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 56dbbab13e564fb593930ae918a52fad741e7ef1..00ff7733d5634425792b4bc2740f20c2452c26b9 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -406,16 +406,17 @@ int QuicHttpStream::DoSendHeaders() {
if (!stream_)
return ERR_UNEXPECTED;
- if (request_.empty() && !stream_->CanWrite(
- base::Bind(&QuicHttpStream::OnIOComplete,
- weak_factory_.GetWeakPtr()))) {
- // Do not compress headers unless it is likely that they can be sent.
- next_state_ = STATE_SEND_HEADERS;
- return ERR_IO_PENDING;
+ if (stream_->version() <= QUIC_VERSION_12) {
+ if (request_.empty() && !stream_->CanWrite(
+ base::Bind(&QuicHttpStream::OnIOComplete,
+ weak_factory_.GetWeakPtr()))) {
+ // Do not compress headers unless it is likely that they can be sent.
+ next_state_ = STATE_SEND_HEADERS;
+ return ERR_IO_PENDING;
+ }
+ request_ = stream_->compressor()->CompressHeadersWithPriority(
+ ConvertRequestPriorityToQuicPriority(priority_), request_headers_);
}
- request_ = stream_->compressor()->CompressHeadersWithPriority(
- ConvertRequestPriorityToQuicPriority(priority_), request_headers_);
-
// Log the actual request with the URL Request's net log.
stream_net_log_.AddEvent(
NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS,
@@ -424,14 +425,17 @@ int QuicHttpStream::DoSendHeaders() {
stream_->net_log().AddEvent(
NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS,
base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_));
- request_headers_.clear();
bool has_upload_data = request_body_stream_ != NULL;
next_state_ = STATE_SEND_HEADERS_COMPLETE;
- return stream_->WriteStreamData(
- request_, !has_upload_data,
- base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr()));
+ int rv = (stream_->version() > QUIC_VERSION_12) ?
+ stream_->WriteHeaders(request_headers_, !has_upload_data) :
+ stream_->WriteStreamData(request_, !has_upload_data,
+ base::Bind(&QuicHttpStream::OnIOComplete,
+ weak_factory_.GetWeakPtr()));
+ request_headers_.clear();
+ return rv;
}
int QuicHttpStream::DoSendHeadersComplete(int rv) {
« no previous file with comments | « net/net.gyp ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698