diff options
Diffstat (limited to 'net/base/force_tls_state.h')
-rw-r--r-- | net/base/force_tls_state.h | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/net/base/force_tls_state.h b/net/base/force_tls_state.h index 068d73c..e52adb9 100644 --- a/net/base/force_tls_state.h +++ b/net/base/force_tls_state.h @@ -5,13 +5,11 @@ #ifndef NET_BASE_FORCE_TLS_STATE_H_ #define NET_BASE_FORCE_TLS_STATE_H_ -#include <map> +#include <set> #include <string> #include "base/basictypes.h" #include "base/lock.h" -#include "base/ref_counted.h" -#include "base/time.h" class GURL; @@ -23,7 +21,7 @@ namespace net { // then we refuse to talk to the host over HTTP, treat all certificate errors as // fatal, and refuse to load any mixed content. // -class ForceTLSState : public base::RefCountedThreadSafe<ForceTLSState> { +class ForceTLSState { public: ForceTLSState(); @@ -32,8 +30,7 @@ class ForceTLSState : public base::RefCountedThreadSafe<ForceTLSState> { void DidReceiveHeader(const GURL& url, const std::string& value); // Enable ForceTLS for |host|. - void EnableHost(const std::string& host, base::Time expiry, - bool include_subdomains); + void EnableHost(const std::string& host); // Returns whether |host| has had ForceTLS enabled. bool IsEnabledForHost(const std::string& host); @@ -46,37 +43,13 @@ class ForceTLSState : public base::RefCountedThreadSafe<ForceTLSState> { int* max_age, bool* include_subdomains); - struct State { - base::Time expiry; // the absolute time (UTC) when this record expires - bool include_subdomains; // subdomains included? - }; - - class Delegate { - public: - // This function may not block and may be called with internal locks held. - // Thus it must not reenter the ForceTLSState object. - virtual void StateIsDirty(ForceTLSState* state) = 0; - }; - - void SetDelegate(Delegate*); - - bool Serialise(std::string* output); - bool Deserialise(const std::string& state); - private: - // If we have a callback configured, call it to let our serialiser know that - // our state is dirty. - void DirtyNotify(); - // The set of hosts that have enabled ForceTLS. - std::map<std::string, State> enabled_hosts_; + std::set<std::string> enabled_hosts_; // Protect access to our data members with this lock. Lock lock_; - // Our delegate who gets notified when we are dirtied, or NULL. - Delegate* delegate_; - DISALLOW_COPY_AND_ASSIGN(ForceTLSState); }; |