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

Side by Side Diff: net/tools/quic/quic_simple_server_stream.h

Issue 2518063007: Pass QuicInMemoryCache directly instead of using a singleton. (Closed)
Patch Set: Fix Cronet compile error Created 4 years 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
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 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ 5 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ 6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "net/quic/core/quic_protocol.h" 13 #include "net/quic/core/quic_protocol.h"
14 #include "net/quic/core/quic_spdy_stream.h" 14 #include "net/quic/core/quic_spdy_stream.h"
15 #include "net/spdy/spdy_framer.h" 15 #include "net/spdy/spdy_framer.h"
16 #include "net/tools/quic/quic_in_memory_cache.h"
16 17
17 namespace net { 18 namespace net {
18 19
19 20
20 namespace test { 21 namespace test {
21 class QuicSimpleServerStreamPeer; 22 class QuicSimpleServerStreamPeer;
22 } // namespace test 23 } // namespace test
23 24
24 // All this does right now is aggregate data, and on fin, send an HTTP 25 // All this does right now is aggregate data, and on fin, send an HTTP
25 // response. 26 // response.
26 class QuicSimpleServerStream : public QuicSpdyStream { 27 class QuicSimpleServerStream : public QuicSpdyStream {
27 public: 28 public:
28 QuicSimpleServerStream(QuicStreamId id, QuicSpdySession* session); 29 QuicSimpleServerStream(QuicStreamId id,
30 QuicSpdySession* session,
31 QuicInMemoryCache* in_memory_cache);
29 ~QuicSimpleServerStream() override; 32 ~QuicSimpleServerStream() override;
30 33
31 // QuicSpdyStream 34 // QuicSpdyStream
32 void OnInitialHeadersComplete(bool fin, 35 void OnInitialHeadersComplete(bool fin,
33 size_t frame_len, 36 size_t frame_len,
34 const QuicHeaderList& header_list) override; 37 const QuicHeaderList& header_list) override;
35 void OnTrailingHeadersComplete(bool fin, 38 void OnTrailingHeadersComplete(bool fin,
36 size_t frame_len, 39 size_t frame_len,
37 const QuicHeaderList& header_list) override; 40 const QuicHeaderList& header_list) override;
38 41
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 const std::string& body() { return body_; } 76 const std::string& body() { return body_; }
74 77
75 private: 78 private:
76 friend class test::QuicSimpleServerStreamPeer; 79 friend class test::QuicSimpleServerStreamPeer;
77 80
78 // The parsed headers received from the client. 81 // The parsed headers received from the client.
79 SpdyHeaderBlock request_headers_; 82 SpdyHeaderBlock request_headers_;
80 int64_t content_length_; 83 int64_t content_length_;
81 std::string body_; 84 std::string body_;
82 85
86 QuicInMemoryCache* in_memory_cache_; // Not owned.
87
83 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerStream); 88 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerStream);
84 }; 89 };
85 90
86 } // namespace net 91 } // namespace net
87 92
88 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ 93 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server_session_test.cc ('k') | net/tools/quic/quic_simple_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698