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

Side by Side Diff: net/tools/quic/quic_spdy_client_stream.cc

Issue 185203003: Killing off QUICv12, including cleaning out all of the code for handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted unused StripUint32 Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_server_session_test.cc ('k') | net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include "net/spdy/spdy_framer.h" 7 #include "net/spdy/spdy_framer.h"
8 #include "net/tools/quic/quic_client_session.h" 8 #include "net/tools/quic/quic_client_session.h"
9 #include "net/tools/quic/spdy_utils.h" 9 #include "net/tools/quic/spdy_utils.h"
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 ssize_t QuicSpdyClientStream::SendRequest(const BalsaHeaders& headers, 77 ssize_t QuicSpdyClientStream::SendRequest(const BalsaHeaders& headers,
78 StringPiece body, 78 StringPiece body,
79 bool fin) { 79 bool fin) {
80 SpdyHeaderBlock header_block = 80 SpdyHeaderBlock header_block =
81 SpdyUtils::RequestHeadersToSpdyHeaders(headers); 81 SpdyUtils::RequestHeadersToSpdyHeaders(headers);
82 82
83 bool send_fin_with_headers = fin && body.empty(); 83 bool send_fin_with_headers = fin && body.empty();
84 size_t bytes_sent = body.size(); 84 size_t bytes_sent = body.size();
85 if (version() > QUIC_VERSION_12) { 85 header_bytes_written_ = WriteHeaders(header_block, send_fin_with_headers);
86 header_bytes_written_ = WriteHeaders(header_block, send_fin_with_headers); 86 bytes_sent += header_bytes_written_;
87 bytes_sent += header_bytes_written_;
88 } else {
89 string headers_string =
90 session()->compressor()->CompressHeadersWithPriority(
91 priority(), header_block);
92 WriteOrBufferData(headers_string, send_fin_with_headers);
93 bytes_sent += headers_string.length();
94 }
95 87
96 if (!body.empty()) { 88 if (!body.empty()) {
97 WriteOrBufferData(body, fin); 89 WriteOrBufferData(body, fin);
98 } 90 }
99 91
100 return bytes_sent; 92 return bytes_sent;
101 } 93 }
102 94
103 int QuicSpdyClientStream::ParseResponseHeaders() { 95 int QuicSpdyClientStream::ParseResponseHeaders() {
104 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); 96 size_t read_buf_len = static_cast<size_t>(read_buf_->offset());
(...skipping 20 matching lines...) Expand all
125 return len; 117 return len;
126 } 118 }
127 119
128 // Sends body data to the server and returns the number of bytes sent. 120 // Sends body data to the server and returns the number of bytes sent.
129 void QuicSpdyClientStream::SendBody(const string& data, bool fin) { 121 void QuicSpdyClientStream::SendBody(const string& data, bool fin) {
130 WriteOrBufferData(data, fin); 122 WriteOrBufferData(data, fin);
131 } 123 }
132 124
133 } // namespace tools 125 } // namespace tools
134 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_session_test.cc ('k') | net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698