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

Unified Diff: net/tools/quic/quic_in_memory_cache.h

Issue 2518063007: Pass QuicInMemoryCache directly instead of using a singleton. (Closed)
Patch Set: Fix Cronet compile error Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_in_memory_cache.h
diff --git a/net/tools/quic/quic_in_memory_cache.h b/net/tools/quic/quic_in_memory_cache.h
index b1c4ced33c8712e7b31c1ef2f7e65bea549944e2..90683f4943313aafb44bde8ac77bf45a992a3b7f 100644
--- a/net/tools/quic/quic_in_memory_cache.h
+++ b/net/tools/quic/quic_in_memory_cache.h
@@ -14,26 +14,14 @@
#include "base/files/file_path.h"
#include "base/macros.h"
-#include "base/memory/singleton.h"
#include "base/strings/string_piece.h"
#include "net/http/http_response_headers.h"
#include "net/quic/core/spdy_utils.h"
#include "net/spdy/spdy_framer.h"
#include "url/gurl.h"
-namespace base {
-
-template <typename Type>
-struct DefaultSingletonTraits;
-
-} // namespace base
-
namespace net {
-namespace test {
-class QuicInMemoryCachePeer;
-} // namespace test
-
class QuicServer;
// In-memory cache for HTTP responses.
@@ -139,8 +127,8 @@ class QuicInMemoryCache {
DISALLOW_COPY_AND_ASSIGN(ResourceFile);
};
- // Returns the singleton instance of the cache.
- static QuicInMemoryCache* GetInstance();
+ QuicInMemoryCache();
+ ~QuicInMemoryCache();
// Retrieve a response from this cache for a given host and path..
// If no appropriate response exists, nullptr is returned.
@@ -194,14 +182,6 @@ class QuicInMemoryCache {
std::list<ServerPushInfo> GetServerPushResources(std::string request_url);
private:
- friend struct base::DefaultSingletonTraits<QuicInMemoryCache>;
- friend class test::QuicInMemoryCachePeer;
-
- QuicInMemoryCache();
- ~QuicInMemoryCache();
-
- void ResetForTests();
-
void AddResponseImpl(base::StringPiece host,
base::StringPiece path,
SpecialResponseType response_type,
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698