| 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_server_stream.h" | 5 #include "net/tools/quic/quic_spdy_server_stream.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "net/quic/quic_session.h" | 8 #include "net/quic/quic_session.h" |
| 9 #include "net/spdy/spdy_framer.h" | 9 #include "net/spdy/spdy_framer.h" |
| 10 #include "net/tools/quic/quic_in_memory_cache.h" | 10 #include "net/tools/quic/quic_in_memory_cache.h" |
| 11 #include "net/tools/quic/spdy_utils.h" | 11 #include "net/tools/quic/spdy_utils.h" |
| 12 | 12 |
| 13 using base::StringPiece; | 13 using base::StringPiece; |
| 14 using std::string; | 14 using std::string; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace tools { | 17 namespace tools { |
| 18 | 18 |
| 19 static const size_t kHeaderBufInitialSize = 4096; | 19 static const size_t kHeaderBufInitialSize = 4096; |
| 20 | 20 |
| 21 QuicSpdyServerStream::QuicSpdyServerStream(QuicStreamId id, | 21 QuicSpdyServerStream::QuicSpdyServerStream(QuicStreamId id, |
| 22 QuicSession* session) | 22 QuicSession* session) |
| 23 : ReliableQuicStream(id, session), | 23 : QuicDataStream(id, session), |
| 24 read_buf_(new GrowableIOBuffer()), | 24 read_buf_(new GrowableIOBuffer()), |
| 25 request_headers_received_(false) { | 25 request_headers_received_(false) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 QuicSpdyServerStream::~QuicSpdyServerStream() { | 28 QuicSpdyServerStream::~QuicSpdyServerStream() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 uint32 QuicSpdyServerStream::ProcessData(const char* data, uint32 length) { | 31 uint32 QuicSpdyServerStream::ProcessData(const char* data, uint32 length) { |
| 32 uint32 total_bytes_processed = 0; | 32 uint32 total_bytes_processed = 0; |
| 33 | 33 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // We only support SPDY and HTTP, and neither handles bidirectional streaming. | 127 // We only support SPDY and HTTP, and neither handles bidirectional streaming. |
| 128 if (!read_side_closed()) { | 128 if (!read_side_closed()) { |
| 129 CloseReadSide(); | 129 CloseReadSide(); |
| 130 } | 130 } |
| 131 SendHeaders(response_headers); | 131 SendHeaders(response_headers); |
| 132 WriteOrBufferData(data, true); | 132 WriteOrBufferData(data, true); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace tools | 135 } // namespace tools |
| 136 } // namespace net | 136 } // namespace net |
| OLD | NEW |