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

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

Issue 1423463003: Rename QuicDataStream to QuicSpdyStream. No behavior change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@105435080
Patch Set: Created 5 years, 2 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') | net/tools/quic/quic_spdy_server_stream.h » ('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 "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"
11 #include "net/spdy/spdy_protocol.h" 11 #include "net/spdy/spdy_protocol.h"
12 #include "net/tools/quic/quic_client_session.h" 12 #include "net/tools/quic/quic_client_session.h"
13 #include "net/tools/quic/spdy_balsa_utils.h" 13 #include "net/tools/quic/spdy_balsa_utils.h"
14 14
15 using base::StringPiece; 15 using base::StringPiece;
16 using std::string; 16 using std::string;
17 using base::StringToInt; 17 using base::StringToInt;
18 18
19 namespace net { 19 namespace net {
20 namespace tools { 20 namespace tools {
21 21
22 QuicSpdyClientStream::QuicSpdyClientStream(QuicStreamId id, 22 QuicSpdyClientStream::QuicSpdyClientStream(QuicStreamId id,
23 QuicClientSession* session) 23 QuicClientSession* session)
24 : QuicDataStream(id, session), 24 : QuicSpdyStream(id, session),
25 content_length_(-1), 25 content_length_(-1),
26 response_code_(0), 26 response_code_(0),
27 header_bytes_read_(0), 27 header_bytes_read_(0),
28 header_bytes_written_(0), 28 header_bytes_written_(0),
29 allow_bidirectional_data_(false) {} 29 allow_bidirectional_data_(false) {}
30 30
31 QuicSpdyClientStream::~QuicSpdyClientStream() { 31 QuicSpdyClientStream::~QuicSpdyClientStream() {
32 } 32 }
33 33
34 void QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) { 34 void QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) {
35 if (!allow_bidirectional_data_ && !write_side_closed()) { 35 if (!allow_bidirectional_data_ && !write_side_closed()) {
36 DVLOG(1) << "Got a response before the request was complete. " 36 DVLOG(1) << "Got a response before the request was complete. "
37 << "Aborting request."; 37 << "Aborting request.";
38 CloseWriteSide(); 38 CloseWriteSide();
39 } 39 }
40 QuicDataStream::OnStreamFrame(frame); 40 QuicSpdyStream::OnStreamFrame(frame);
41 } 41 }
42 42
43 void QuicSpdyClientStream::OnStreamHeadersComplete(bool fin, 43 void QuicSpdyClientStream::OnStreamHeadersComplete(bool fin,
44 size_t frame_len) { 44 size_t frame_len) {
45 header_bytes_read_ = frame_len; 45 header_bytes_read_ = frame_len;
46 QuicDataStream::OnStreamHeadersComplete(fin, frame_len); 46 QuicSpdyStream::OnStreamHeadersComplete(fin, frame_len);
47 if (!ParseResponseHeaders(decompressed_headers().data(), 47 if (!ParseResponseHeaders(decompressed_headers().data(),
48 decompressed_headers().length())) { 48 decompressed_headers().length())) {
49 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 49 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
50 return; 50 return;
51 } 51 }
52 MarkHeadersConsumed(decompressed_headers().length()); 52 MarkHeadersConsumed(decompressed_headers().length());
53 } 53 }
54 54
55 void QuicSpdyClientStream::OnDataAvailable() { 55 void QuicSpdyClientStream::OnDataAvailable() {
56 while (HasBytesToRead()) { 56 while (HasBytesToRead()) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 void QuicSpdyClientStream::SendBody(const string& data, 131 void QuicSpdyClientStream::SendBody(const string& data,
132 bool fin, 132 bool fin,
133 QuicAckListenerInterface* delegate) { 133 QuicAckListenerInterface* delegate) {
134 WriteOrBufferData(data, fin, delegate); 134 WriteOrBufferData(data, fin, delegate);
135 } 135 }
136 136
137 } // namespace tools 137 } // namespace tools
138 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | net/tools/quic/quic_spdy_server_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698