| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ | 5 #ifndef NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ |
| 6 #define NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ | 6 #define NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void SetDelegate(Delegate*); | 63 void SetDelegate(Delegate*); |
| 64 | 64 |
| 65 bool Serialise(std::string* output); | 65 bool Serialise(std::string* output); |
| 66 bool Deserialise(const std::string& state); | 66 bool Deserialise(const std::string& state); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 // If we have a callback configured, call it to let our serialiser know that | 69 // If we have a callback configured, call it to let our serialiser know that |
| 70 // our state is dirty. | 70 // our state is dirty. |
| 71 void DirtyNotify(); | 71 void DirtyNotify(); |
| 72 | 72 |
| 73 // The set of hosts that have enabled StrictTransportSecurity. | 73 // The set of hosts that have enabled StrictTransportSecurity. The keys here |
| 74 // are SHA256(DNSForm(domain)) where DNSForm converts from dotted form |
| 75 // ('www.google.com') to the form used in DNS: "\x03www\x06google\x03com" |
| 74 std::map<std::string, State> enabled_hosts_; | 76 std::map<std::string, State> enabled_hosts_; |
| 75 | 77 |
| 76 // Protect access to our data members with this lock. | 78 // Protect access to our data members with this lock. |
| 77 Lock lock_; | 79 Lock lock_; |
| 78 | 80 |
| 79 // Our delegate who gets notified when we are dirtied, or NULL. | 81 // Our delegate who gets notified when we are dirtied, or NULL. |
| 80 Delegate* delegate_; | 82 Delegate* delegate_; |
| 81 | 83 |
| 84 static std::string CanonicaliseHost(const std::string& host); |
| 85 |
| 82 DISALLOW_COPY_AND_ASSIGN(StrictTransportSecurityState); | 86 DISALLOW_COPY_AND_ASSIGN(StrictTransportSecurityState); |
| 83 }; | 87 }; |
| 84 | 88 |
| 85 } // namespace net | 89 } // namespace net |
| 86 | 90 |
| 87 #endif // NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ | 91 #endif // NET_BASE_STRICT_TRANSPORT_SECURITY_STATE_H_ |
| OLD | NEW |