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

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

Issue 2561913003: Create a QUIC wrapper around a mutex and a mutex lock. (Closed)
Patch Set: fix Created 4 years 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/quic/test_tools/quic_crypto_server_config_peer.cc ('k') | net/tools/quic/quic_http_response_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_http_response_cache.h
diff --git a/net/tools/quic/quic_http_response_cache.h b/net/tools/quic/quic_http_response_cache.h
index 3a1857cf258b4a8ee7d22cb8f251a14a6887618f..3518a63269ad054243fe30c0089b472a8c23fb8d 100644
--- a/net/tools/quic/quic_http_response_cache.h
+++ b/net/tools/quic/quic_http_response_cache.h
@@ -17,6 +17,7 @@
#include "base/strings/string_piece.h"
#include "net/http/http_response_headers.h"
#include "net/quic/core/spdy_utils.h"
+#include "net/quic/platform/api/quic_mutex.h"
#include "net/spdy/spdy_framer.h"
#include "url/gurl.h"
@@ -201,17 +202,19 @@ class QuicHttpResponseCache {
ServerPushInfo resource);
// Cached responses.
- std::unordered_map<std::string, std::unique_ptr<Response>> responses_;
+ std::unordered_map<std::string, std::unique_ptr<Response>> responses_
+ GUARDED_BY(response_mutex_);
// The default response for cache misses, if set.
- std::unique_ptr<Response> default_response_;
+ std::unique_ptr<Response> default_response_ GUARDED_BY(response_mutex_);
// A map from request URL to associated server push responses (if any).
- std::multimap<std::string, ServerPushInfo> server_push_resources_;
+ std::multimap<std::string, ServerPushInfo> server_push_resources_
+ GUARDED_BY(response_mutex_);
// Protects against concurrent access from test threads setting responses, and
// server threads accessing those responses.
- mutable base::Lock response_mutex_;
+ mutable QuicMutex response_mutex_;
DISALLOW_COPY_AND_ASSIGN(QuicHttpResponseCache);
};
« no previous file with comments | « net/quic/test_tools/quic_crypto_server_config_peer.cc ('k') | net/tools/quic/quic_http_response_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698