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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 // Cached responses. | 228 // Cached responses. |
229 ResponseMap responses_; | 229 ResponseMap responses_; |
230 | 230 |
231 // The default response for cache misses, if set. | 231 // The default response for cache misses, if set. |
232 std::unique_ptr<Response> default_response_; | 232 std::unique_ptr<Response> default_response_; |
233 | 233 |
234 // A map from request URL to associated server push responses (if any). | 234 // A map from request URL to associated server push responses (if any). |
235 std::multimap<std::string, ServerPushInfo> server_push_resources_; | 235 std::multimap<std::string, ServerPushInfo> server_push_resources_; |
236 | 236 |
| 237 // Protects against concurrent access from test threads setting responses, and |
| 238 // server threads accessing those responses. |
| 239 mutable base::Lock response_mutex_; |
| 240 |
237 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache); | 241 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache); |
238 }; | 242 }; |
239 | 243 |
240 } // namespace net | 244 } // namespace net |
241 | 245 |
242 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ | 246 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ |
OLD | NEW |