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

Unified Diff: net/http/transport_security_state.h

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: fix compile Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/http/transport_security_state.h
diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h
index 19ba839752c459f78adf174a8e185b6b0a5e6ad7..71f36eef4d739cd7ec18da2a5268dd0c2079e143 100644
--- a/net/http/transport_security_state.h
+++ b/net/http/transport_security_state.h
@@ -15,7 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
-#include "base/threading/non_thread_safe.h"
+#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "net/base/expiring_cache.h"
#include "net/base/hash_value.h"
@@ -47,8 +47,7 @@ void NET_EXPORT_PRIVATE SetTransportSecurityStateSourceForTesting(
// http://tools.ietf.org/html/ietf-websec-strict-transport-sec, and
// HTTP-based dynamic public key pinning (HPKP) is defined in
// http://tools.ietf.org/html/ietf-websec-key-pinning.
-class NET_EXPORT TransportSecurityState
- : NON_EXPORTED_BASE(public base::NonThreadSafe) {
+class NET_EXPORT TransportSecurityState {
public:
class NET_EXPORT Delegate {
public:
@@ -566,6 +565,10 @@ class NET_EXPORT TransportSecurityState
const HostPortPair& host_port_pair,
const SSLInfo& ssl_info);
+ void AssertCalledOnValidThread() const {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ }
+
// For unit tests only. Causes CheckCTRequirements() to return
// CT_REQUIREMENTS_NOT_MET (if |*required| is true) or CT_REQUIREMENTS_MET (if
// |*required| is false) for non-compliant connections by default (that is,
@@ -713,6 +716,8 @@ class NET_EXPORT TransportSecurityState
ReportCache sent_hpkp_reports_cache_;
ReportCache sent_expect_ct_reports_cache_;
+ THREAD_CHECKER(thread_checker_);
+
DISALLOW_COPY_AND_ASSIGN(TransportSecurityState);
};

Powered by Google App Engine
This is Rietveld 408576698