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

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

Issue 1035533006: Unify the QUIC client classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ssize_t Created 5 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
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | no next file » | 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/spdy_utils.h" 10 #include "net/quic/spdy_utils.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 size_t end = status.find(" "); 93 size_t end = status.find(" ");
94 if (end != string::npos) { 94 if (end != string::npos) {
95 status.erase(end); 95 status.erase(end);
96 } 96 }
97 if (!StringToInt(status, &response_code_)) { 97 if (!StringToInt(status, &response_code_)) {
98 return false; // Invalid response code. 98 return false; // Invalid response code.
99 } 99 }
100 return true; 100 return true;
101 } 101 }
102 102
103 ssize_t QuicSpdyClientStream::SendRequest(const SpdyHeaderBlock& headers, 103 size_t QuicSpdyClientStream::SendRequest(const SpdyHeaderBlock& headers,
104 StringPiece body, 104 StringPiece body,
105 bool fin) { 105 bool fin) {
106 bool send_fin_with_headers = fin && body.empty(); 106 bool send_fin_with_headers = fin && body.empty();
107 size_t bytes_sent = body.size(); 107 size_t bytes_sent = body.size();
108 header_bytes_written_ = 108 header_bytes_written_ =
109 WriteHeaders(headers, send_fin_with_headers, nullptr); 109 WriteHeaders(headers, send_fin_with_headers, nullptr);
110 bytes_sent += header_bytes_written_; 110 bytes_sent += header_bytes_written_;
111 111
112 if (!body.empty()) { 112 if (!body.empty()) {
113 WriteOrBufferData(body, fin, nullptr); 113 WriteOrBufferData(body, fin, nullptr);
114 } 114 }
115 115
116 return bytes_sent; 116 return bytes_sent;
117 } 117 }
118 118
119 void QuicSpdyClientStream::SendBody(const string& data, bool fin) { 119 void QuicSpdyClientStream::SendBody(const string& data, bool fin) {
120 SendBody(data, fin, nullptr); 120 SendBody(data, fin, nullptr);
121 } 121 }
122 122
123 void QuicSpdyClientStream::SendBody( 123 void QuicSpdyClientStream::SendBody(
124 const string& data, bool fin, 124 const string& data, bool fin,
125 QuicAckNotifier::DelegateInterface* delegate) { 125 QuicAckNotifier::DelegateInterface* delegate) {
126 WriteOrBufferData(data, fin, delegate); 126 WriteOrBufferData(data, fin, delegate);
127 } 127 }
128 128
129 } // namespace tools 129 } // namespace tools
130 } // namespace net 130 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698