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

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

Issue 1041853002: Land Recent QUIC Changes until 03/25/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rch_patch_1036023002
Patch Set: Created 5 years, 8 months 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
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_time_wait_list_manager_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Simulate a special behavior at a particular path. 89 // Simulate a special behavior at a particular path.
90 void AddSpecialResponse(base::StringPiece host, 90 void AddSpecialResponse(base::StringPiece host,
91 base::StringPiece path, 91 base::StringPiece path,
92 SpecialResponseType response_type); 92 SpecialResponseType response_type);
93 93
94 // |cache_cirectory| can be generated using `wget -p --save-headers <url>`. 94 // |cache_cirectory| can be generated using `wget -p --save-headers <url>`.
95 void InitializeFromDirectory(const std::string& cache_directory); 95 void InitializeFromDirectory(const std::string& cache_directory);
96 96
97 private: 97 private:
98 typedef base::hash_map<std::string, Response*> ResponseMap; 98 typedef base::hash_map<std::string, Response*> ResponseMap;
99
99 friend struct DefaultSingletonTraits<QuicInMemoryCache>; 100 friend struct DefaultSingletonTraits<QuicInMemoryCache>;
100 friend class test::QuicInMemoryCachePeer; 101 friend class test::QuicInMemoryCachePeer;
101 102
102 QuicInMemoryCache(); 103 QuicInMemoryCache();
103 ~QuicInMemoryCache(); 104 ~QuicInMemoryCache();
104 105
105 void ResetForTests(); 106 void ResetForTests();
106 107
107 void AddResponseImpl(base::StringPiece host, 108 void AddResponseImpl(base::StringPiece host,
108 base::StringPiece path, 109 base::StringPiece path,
109 SpecialResponseType response_type, 110 SpecialResponseType response_type,
110 const SpdyHeaderBlock& response_headers, 111 const SpdyHeaderBlock& response_headers,
111 base::StringPiece response_body); 112 base::StringPiece response_body);
112 113
113 std::string GetKey(base::StringPiece host, base::StringPiece path) const; 114 std::string GetKey(base::StringPiece host, base::StringPiece path) const;
114 115
115 // Cached responses. 116 // Cached responses.
116 ResponseMap responses_; 117 ResponseMap responses_;
117 118
118 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache); 119 DISALLOW_COPY_AND_ASSIGN(QuicInMemoryCache);
119 }; 120 };
120 121
121 } // namespace tools 122 } // namespace tools
122 } // namespace net 123 } // namespace net
123 124
124 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_ 125 #endif // NET_TOOLS_QUIC_QUIC_IN_MEMORY_CACHE_H_
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_time_wait_list_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698