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

Unified Diff: net/quic/core/crypto/quic_crypto_server_config.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
Index: net/quic/core/crypto/quic_crypto_server_config.h
diff --git a/net/quic/core/crypto/quic_crypto_server_config.h b/net/quic/core/crypto/quic_crypto_server_config.h
index f8f10ba3d458ff6e8e12dad9ae23cd9948b1524c..28f65f7564df000aa9aada7820a4ba14deb40150 100644
--- a/net/quic/core/crypto/quic_crypto_server_config.h
+++ b/net/quic/core/crypto/quic_crypto_server_config.h
@@ -16,7 +16,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
-#include "base/synchronization/lock.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/core/crypto/crypto_handshake.h"
@@ -30,6 +29,7 @@
#include "net/quic/core/proto/source_address_token.pb.h"
#include "net/quic/core/quic_time.h"
#include "net/quic/platform/api/quic_export.h"
+#include "net/quic/platform/api/quic_mutex.h"
#include "net/quic/platform/api/quic_socket_address.h"
namespace net {
@@ -739,18 +739,19 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// 1) configs_.empty() <-> primary_config_ == nullptr
// 2) primary_config_ != nullptr -> primary_config_->is_primary
// 3) ∀ c∈configs_, c->is_primary <-> c == primary_config_
- mutable base::Lock configs_lock_;
+ mutable QuicMutex configs_lock_;
// configs_ contains all active server configs. It's expected that there are
// about half-a-dozen configs active at any one time.
- ConfigMap configs_;
+ ConfigMap configs_ GUARDED_BY(configs_lock_);
// primary_config_ points to a Config (which is also in |configs_|) which is
// the primary config - i.e. the one that we'll give out to new clients.
- mutable scoped_refptr<Config> primary_config_;
+ mutable scoped_refptr<Config> primary_config_ GUARDED_BY(configs_lock_);
// next_config_promotion_time_ contains the nearest, future time when an
// active config will be promoted to primary.
- mutable QuicWallTime next_config_promotion_time_;
+ mutable QuicWallTime next_config_promotion_time_ GUARDED_BY(configs_lock_);
// Callback to invoke when the primary config changes.
- std::unique_ptr<PrimaryConfigChangedCallback> primary_config_changed_cb_;
+ std::unique_ptr<PrimaryConfigChangedCallback> primary_config_changed_cb_
+ GUARDED_BY(configs_lock_);
// Used to protect the source-address tokens that are given to clients.
CryptoSecretBoxer source_address_token_boxer_;
« no previous file with comments | « net/quic/core/crypto/local_strike_register_client.cc ('k') | net/quic/core/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698