OLD | NEW |
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 10 matching lines...) Expand all Loading... |
21 : QuicDataStream(id, session), | 21 : QuicDataStream(id, session), |
22 read_buf_(new GrowableIOBuffer()), | 22 read_buf_(new GrowableIOBuffer()), |
23 response_headers_received_(false), | 23 response_headers_received_(false), |
24 header_bytes_read_(0), | 24 header_bytes_read_(0), |
25 header_bytes_written_(0) { | 25 header_bytes_written_(0) { |
26 } | 26 } |
27 | 27 |
28 QuicSpdyClientStream::~QuicSpdyClientStream() { | 28 QuicSpdyClientStream::~QuicSpdyClientStream() { |
29 } | 29 } |
30 | 30 |
31 bool QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) { | 31 void QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) { |
32 if (!write_side_closed()) { | 32 if (!write_side_closed()) { |
33 DVLOG(1) << "Got a response before the request was complete. " | 33 DVLOG(1) << "Got a response before the request was complete. " |
34 << "Aborting request."; | 34 << "Aborting request."; |
35 CloseWriteSide(); | 35 CloseWriteSide(); |
36 } | 36 } |
37 return QuicDataStream::OnStreamFrame(frame); | 37 QuicDataStream::OnStreamFrame(frame); |
38 } | 38 } |
39 | 39 |
40 void QuicSpdyClientStream::OnStreamHeadersComplete(bool fin, | 40 void QuicSpdyClientStream::OnStreamHeadersComplete(bool fin, |
41 size_t frame_len) { | 41 size_t frame_len) { |
42 header_bytes_read_ = frame_len; | 42 header_bytes_read_ = frame_len; |
43 QuicDataStream::OnStreamHeadersComplete(fin, frame_len); | 43 QuicDataStream::OnStreamHeadersComplete(fin, frame_len); |
44 } | 44 } |
45 | 45 |
46 uint32 QuicSpdyClientStream::ProcessData(const char* data, | 46 uint32 QuicSpdyClientStream::ProcessData(const char* data, |
47 uint32 data_len) { | 47 uint32 data_len) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return len; | 118 return len; |
119 } | 119 } |
120 | 120 |
121 // Sends body data to the server and returns the number of bytes sent. | 121 // Sends body data to the server and returns the number of bytes sent. |
122 void QuicSpdyClientStream::SendBody(const string& data, bool fin) { | 122 void QuicSpdyClientStream::SendBody(const string& data, bool fin) { |
123 WriteOrBufferData(data, fin, NULL); | 123 WriteOrBufferData(data, fin, NULL); |
124 } | 124 } |
125 | 125 |
126 } // namespace tools | 126 } // namespace tools |
127 } // namespace net | 127 } // namespace net |
OLD | NEW |