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 #ifndef NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ | 5 #ifndef NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ |
6 #define NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ | 6 #define NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 CLOSE_CONNECTION, // Close the connection (sending the close packet). | 33 CLOSE_CONNECTION, // Close the connection (sending the close packet). |
34 IGNORE_REQUEST, // Do nothing, expect the client to time out. | 34 IGNORE_REQUEST, // Do nothing, expect the client to time out. |
35 }; | 35 }; |
36 | 36 |
37 // Container for response header/body pairs. | 37 // Container for response header/body pairs. |
38 class Response { | 38 class Response { |
39 public: | 39 public: |
40 Response(); | 40 Response(); |
41 ~Response(); | 41 ~Response(); |
42 | 42 |
43 const SpecialResponseType response_type() const { return response_type_; } | 43 SpecialResponseType response_type() const { return response_type_; } |
44 const SpdyHeaderBlock& headers() const { return headers_; } | 44 const SpdyHeaderBlock& headers() const { return headers_; } |
45 const StringPiece body() const { return StringPiece(body_); } | 45 const StringPiece body() const { return StringPiece(body_); } |
46 | 46 |
47 private: | 47 private: |
48 friend class QuicInMemoryCache; | 48 friend class QuicInMemoryCache; |
49 | 49 |
50 void set_response_type(SpecialResponseType response_type) { | 50 void set_response_type(SpecialResponseType response_type) { |
51 response_type_ = response_type; | 51 response_type_ = response_type; |
52 } | 52 } |
53 void set_headers(const SpdyHeaderBlock& headers) { | 53 void set_headers(const SpdyHeaderBlock& headers) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // Cached responses. | 115 // Cached responses. |
116 ResponseMap responses_; | 116 ResponseMap responses_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache); | 118 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace tools | 121 } // namespace tools |
122 } // namespace net | 122 } // namespace net |
123 | 123 |
124 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ | 124 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ |
OLD | NEW |