diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 17:20:28 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 17:20:28 +0000 |
commit | f060be3754a92a80e2f4402bde51763663f444d9 (patch) | |
tree | d2805ea3f4600fcdad167345501e1f17111ec2f5 /net/base/transport_security_state.h | |
parent | f2e430a18f74fcb5972945c05cc08aa321ca6953 (diff) | |
download | chromium_src-f060be3754a92a80e2f4402bde51763663f444d9.zip chromium_src-f060be3754a92a80e2f4402bde51763663f444d9.tar.gz chromium_src-f060be3754a92a80e2f4402bde51763663f444d9.tar.bz2 |
HSTS: add net-internals UI.
This change adds a simple DOMUI interface to the HSTS list. Since the
list is stored, hashed in memory and on disk, there's no list of
entries. But the set can be queried and we can provide insertion and
deletion.
BUG=none
TEST=Open about:net-internals, goto HSTS tab.
Review URL: http://codereview.chromium.org/6500010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/transport_security_state.h')
-rw-r--r-- | net/base/transport_security_state.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/base/transport_security_state.h b/net/base/transport_security_state.h index 768ccbb..05061ca 100644 --- a/net/base/transport_security_state.h +++ b/net/base/transport_security_state.h @@ -47,17 +47,26 @@ class TransportSecurityState : DomainState() : mode(MODE_STRICT), created(base::Time::Now()), - include_subdomains(false) { } + include_subdomains(false), + preloaded(false) { } Mode mode; base::Time created; // when this host entry was first created base::Time expiry; // the absolute time (UTC) when this record expires bool include_subdomains; // subdomains included? + + // The follow members are not valid when stored in |enabled_hosts_|. + bool preloaded; // is this a preloaded entry? + std::string domain; // the domain which matched }; // Enable TransportSecurity for |host|. void EnableHost(const std::string& host, const DomainState& state); + // Delete any entry for |host|. If |host| doesn't have an exact entry then no + // action is taken. Returns true iff an entry was deleted. + bool DeleteHost(const std::string& host); + // Returns true if |host| has TransportSecurity enabled. If that case, // *result is filled out. bool IsEnabledForHost(DomainState* result, const std::string& host); @@ -101,8 +110,8 @@ class TransportSecurityState : // our state is dirty. void DirtyNotify(); - static std::string CanonicaliseHost(const std::string& host); - static bool IsPreloadedSTS(const std::string& canonicalised_host, + static std::string CanonicalizeHost(const std::string& host); + static bool IsPreloadedSTS(const std::string& canonicalized_host, bool* out_include_subdomains); // The set of hosts that have enabled TransportSecurity. The keys here |