Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TRANSPORT_SECURITY_STATE_H_ | 5 #ifndef NET_BASE_TRANSPORT_SECURITY_STATE_H_ |
| 6 #define NET_BASE_TRANSPORT_SECURITY_STATE_H_ | 6 #define NET_BASE_TRANSPORT_SECURITY_STATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 // SPDY_ONLY (aka X-Bodge-Transport-Security) is a hopefully temporary | 40 // SPDY_ONLY (aka X-Bodge-Transport-Security) is a hopefully temporary |
| 41 // measure. It implies: | 41 // measure. It implies: |
| 42 // * We'll request HTTP URLs over HTTPS iff we have SPDY support. | 42 // * We'll request HTTP URLs over HTTPS iff we have SPDY support. |
| 43 // * Certificate issues are fatal. | 43 // * Certificate issues are fatal. |
| 44 MODE_SPDY_ONLY = 2, | 44 MODE_SPDY_ONLY = 2, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 DomainState() | 47 DomainState() |
| 48 : mode(MODE_STRICT), | 48 : mode(MODE_STRICT), |
| 49 created(base::Time::Now()), | 49 created(base::Time::Now()), |
| 50 include_subdomains(false) { } | 50 include_subdomains(false), |
| 51 preloaded(false) { } | |
| 51 | 52 |
| 52 Mode mode; | 53 Mode mode; |
| 53 base::Time created; // when this host entry was first created | 54 base::Time created; // when this host entry was first created |
| 54 base::Time expiry; // the absolute time (UTC) when this record expires | 55 base::Time expiry; // the absolute time (UTC) when this record expires |
| 55 bool include_subdomains; // subdomains included? | 56 bool include_subdomains; // subdomains included? |
| 57 | |
| 58 // The follow members are not valid when stored in _enabled_hosts. | |
|
willchan no longer on Chromium
2011/02/11 21:16:27
enabled_hosts_
| |
| 59 bool preloaded; // is this a preloaded entry? | |
| 60 std::string domain; // the domain which matched | |
| 56 }; | 61 }; |
| 57 | 62 |
| 58 // Enable TransportSecurity for |host|. | 63 // Enable TransportSecurity for |host|. |
| 59 void EnableHost(const std::string& host, const DomainState& state); | 64 void EnableHost(const std::string& host, const DomainState& state); |
| 60 | 65 |
| 66 // Delete any entry for |host|. If |host| doesn't have an exact entry then no | |
| 67 // action is taken. Returns true iff an entry was deleted. | |
| 68 bool DeleteHost(const std::string& host); | |
| 69 | |
| 61 // Returns true if |host| has TransportSecurity enabled. If that case, | 70 // Returns true if |host| has TransportSecurity enabled. If that case, |
| 62 // *result is filled out. | 71 // *result is filled out. |
| 63 bool IsEnabledForHost(DomainState* result, const std::string& host); | 72 bool IsEnabledForHost(DomainState* result, const std::string& host); |
| 64 | 73 |
| 65 // Deletes all records created since a given time. | 74 // Deletes all records created since a given time. |
| 66 void DeleteSince(const base::Time& time); | 75 void DeleteSince(const base::Time& time); |
| 67 | 76 |
| 68 // Returns |true| if |value| parses as a valid *-Transport-Security | 77 // Returns |true| if |value| parses as a valid *-Transport-Security |
| 69 // header value. The values of max-age and and includeSubDomains are | 78 // header value. The values of max-age and and includeSubDomains are |
| 70 // returned in |max_age| and |include_subdomains|, respectively. The out | 79 // returned in |max_age| and |include_subdomains|, respectively. The out |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 121 |
| 113 // Our delegate who gets notified when we are dirtied, or NULL. | 122 // Our delegate who gets notified when we are dirtied, or NULL. |
| 114 Delegate* delegate_; | 123 Delegate* delegate_; |
| 115 | 124 |
| 116 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 125 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
| 117 }; | 126 }; |
| 118 | 127 |
| 119 } // namespace net | 128 } // namespace net |
| 120 | 129 |
| 121 #endif // NET_BASE_TRANSPORT_SECURITY_STATE_H_ | 130 #endif // NET_BASE_TRANSPORT_SECURITY_STATE_H_ |
| OLD | NEW |