| 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_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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // parameters are not modified if the function returns |false|. | 73 // parameters are not modified if the function returns |false|. |
| 74 static bool ParseHeader(const std::string& value, | 74 static bool ParseHeader(const std::string& value, |
| 75 int* max_age, | 75 int* max_age, |
| 76 bool* include_subdomains); | 76 bool* include_subdomains); |
| 77 | 77 |
| 78 class Delegate { | 78 class Delegate { |
| 79 public: | 79 public: |
| 80 // This function may not block and may be called with internal locks held. | 80 // This function may not block and may be called with internal locks held. |
| 81 // Thus it must not reenter the TransportSecurityState object. | 81 // Thus it must not reenter the TransportSecurityState object. |
| 82 virtual void StateIsDirty(TransportSecurityState* state) = 0; | 82 virtual void StateIsDirty(TransportSecurityState* state) = 0; |
| 83 |
| 84 protected: |
| 85 virtual ~Delegate() {} |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 void SetDelegate(Delegate*); | 88 void SetDelegate(Delegate*); |
| 86 | 89 |
| 87 bool Serialise(std::string* output); | 90 bool Serialise(std::string* output); |
| 88 bool Deserialise(const std::string& state, bool* dirty); | 91 bool Deserialise(const std::string& state, bool* dirty); |
| 89 | 92 |
| 90 private: | 93 private: |
| 91 friend class base::RefCountedThreadSafe<TransportSecurityState>; | 94 friend class base::RefCountedThreadSafe<TransportSecurityState>; |
| 92 FRIEND_TEST(TransportSecurityStateTest, IsPreloaded); | 95 FRIEND_TEST(TransportSecurityStateTest, IsPreloaded); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 108 static std::string CanonicaliseHost(const std::string& host); | 111 static std::string CanonicaliseHost(const std::string& host); |
| 109 static bool isPreloadedSTS(const std::string& canonicalised_host, | 112 static bool isPreloadedSTS(const std::string& canonicalised_host, |
| 110 bool* out_include_subdomains); | 113 bool* out_include_subdomains); |
| 111 | 114 |
| 112 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 115 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 } // namespace net | 118 } // namespace net |
| 116 | 119 |
| 117 #endif // NET_BASE_TRANSPORT_SECURITY_STATE_H_ | 120 #endif // NET_BASE_TRANSPORT_SECURITY_STATE_H_ |
| OLD | NEW |