| 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" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
| 13 #include "net/spdy/spdy_framer.h" | 13 #include "net/spdy/spdy_framer.h" |
| 14 | 14 |
| 15 template <typename T> struct DefaultSingletonTraits; | 15 template <typename T> struct DefaultSingletonTraits; |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 namespace tools { | 18 namespace tools { |
| 19 | 19 |
| 20 namespace test { | 20 namespace test { |
| 21 class QuicInMemoryCachePeer; | 21 class QuicInMemoryCachePeer; |
| 22 } // namespace | 22 } // namespace test |
| 23 | 23 |
| 24 class QuicServer; | 24 class QuicServer; |
| 25 | 25 |
| 26 // In-memory cache for HTTP responses. | 26 // In-memory cache for HTTP responses. |
| 27 // Reads from disk cache generated by: | 27 // Reads from disk cache generated by: |
| 28 // `wget -p --save_headers <url>` | 28 // `wget -p --save_headers <url>` |
| 29 class QuicInMemoryCache { | 29 class QuicInMemoryCache { |
| 30 public: | 30 public: |
| 31 enum SpecialResponseType { | 31 enum SpecialResponseType { |
| 32 REGULAR_RESPONSE, // Send the headers and body like a server should. | 32 REGULAR_RESPONSE, // Send the headers and body like a server should. |
| (...skipping 82 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 |