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

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

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/tools/quic/quic_http_response_cache.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.h » ('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.cc
diff --git a/net/tools/quic/quic_http_response_cache.cc b/net/tools/quic/quic_http_response_cache.cc
index 7057a2dbe2e6ab7d84d5ef330b4d498b7365341f..bc6c819f5249edd34b41407fb565b7b89ec4d4f0 100644
--- a/net/tools/quic/quic_http_response_cache.cc
+++ b/net/tools/quic/quic_http_response_cache.cc
@@ -163,7 +163,7 @@ void QuicHttpResponseCache::ResourceFile::HandleXOriginalUrl() {
const QuicHttpResponseCache::Response* QuicHttpResponseCache::GetResponse(
StringPiece host,
StringPiece path) const {
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
auto it = responses_.find(GetKey(host, path));
if (it == responses_.end()) {
@@ -201,7 +201,7 @@ void QuicHttpResponseCache::AddSimpleResponseWithServerPushResources(
}
void QuicHttpResponseCache::AddDefaultResponse(Response* response) {
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
default_response_.reset(response);
}
@@ -288,7 +288,7 @@ void QuicHttpResponseCache::InitializeFromDirectory(
std::list<ServerPushInfo> QuicHttpResponseCache::GetServerPushResources(
string request_url) {
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
std::list<ServerPushInfo> resources;
auto resource_range = server_push_resources_.equal_range(request_url);
@@ -302,7 +302,7 @@ std::list<ServerPushInfo> QuicHttpResponseCache::GetServerPushResources(
QuicHttpResponseCache::~QuicHttpResponseCache() {
{
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
responses_.clear();
}
}
@@ -313,7 +313,7 @@ void QuicHttpResponseCache::AddResponseImpl(StringPiece host,
SpdyHeaderBlock response_headers,
StringPiece response_body,
SpdyHeaderBlock response_trailers) {
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
DCHECK(!host.empty()) << "Host must be populated, e.g. \"www.google.com\"";
string key = GetKey(host, path);
@@ -349,7 +349,7 @@ void QuicHttpResponseCache::MaybeAddServerPushResources(
<< " push url " << push_resource.request_url
<< " response headers " << push_resource.headers.DebugString();
{
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
server_push_resources_.insert(std::make_pair(request_url, push_resource));
}
string host = push_resource.request_url.host();
@@ -359,7 +359,7 @@ void QuicHttpResponseCache::MaybeAddServerPushResources(
string path = push_resource.request_url.path();
bool found_existing_response = false;
{
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
found_existing_response =
base::ContainsKey(responses_, GetKey(host, path));
}
@@ -376,7 +376,7 @@ void QuicHttpResponseCache::MaybeAddServerPushResources(
bool QuicHttpResponseCache::PushResourceExistsInCache(
string original_request_url,
ServerPushInfo resource) {
- base::AutoLock lock(response_mutex_);
+ QuicWriterMutexLock lock(&response_mutex_);
auto resource_range =
server_push_resources_.equal_range(original_request_url);
for (auto it = resource_range.first; it != resource_range.second; ++it) {
« no previous file with comments | « net/tools/quic/quic_http_response_cache.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698