Sort unlaunched apps on app list start page by apps grid order.
[chromium-blink-merge.git] / net / quic / quic_spdy_server_stream.h
bloba8bd9f39618b1d5de2f9afc1b274d6ceaf5067a1
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_
6 #define NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "net/base/io_buffer.h"
12 #include "net/quic/quic_data_stream.h"
13 #include "net/quic/quic_protocol.h"
14 #include "url/gurl.h"
16 namespace net {
18 class HttpResponseHeaders;
19 class QuicSession;
21 namespace test {
22 class QuicSpdyServerStreamPeer;
23 } // namespace test
25 // All this does right now is aggregate data, and on fin, send an HTTP
26 // response.
27 class QuicSpdyServerStream : public QuicDataStream {
28 public:
29 QuicSpdyServerStream(QuicStreamId id, QuicSession* session);
30 ~QuicSpdyServerStream() override;
32 // ReliableQuicStream implementation called by the session when there's
33 // data for us.
34 uint32 ProcessData(const char* data, uint32 data_len) override;
35 void OnFinRead() override;
37 void ParseRequestHeaders();
39 private:
40 friend class test::QuicSpdyServerStreamPeer;
42 // Sends a basic 200 response using SendHeaders for the headers and WriteData
43 // for the body.
44 void SendResponse();
46 // Sends a basic 500 response using SendHeaders for the headers and WriteData
47 // for the body
48 void SendErrorResponse();
50 void SendHeadersAndBody(const HttpResponseHeaders& response_headers,
51 base::StringPiece body);
53 SpdyHeaderBlock headers_;
54 std::string body_;
55 GURL request_url_;
57 // Buffer into which response header data is read.
58 scoped_refptr<GrowableIOBuffer> read_buf_;
59 bool request_headers_received_;
61 DISALLOW_COPY_AND_ASSIGN(QuicSpdyServerStream);
64 } // namespace net
66 #endif // NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_