OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TransportSecurityState maintains an in memory database containing the | 5 // TransportSecurityState maintains an in memory database containing the |
6 // list of hosts that currently have transport security enabled. This | 6 // list of hosts that currently have transport security enabled. This |
7 // singleton object deals with writing that data out to disk as needed and | 7 // singleton object deals with writing that data out to disk as needed and |
8 // loading it at startup. | 8 // loading it at startup. |
9 | 9 |
10 // At startup we need to load the transport security state from the | 10 // At startup we need to load the transport security state from the |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // state; false otherwise. | 114 // state; false otherwise. |
115 static bool Deserialize(const std::string& serialized, | 115 static bool Deserialize(const std::string& serialized, |
116 bool* dirty, | 116 bool* dirty, |
117 TransportSecurityState* state); | 117 TransportSecurityState* state); |
118 | 118 |
119 void CompleteLoad(const std::string& state); | 119 void CompleteLoad(const std::string& state); |
120 | 120 |
121 TransportSecurityState* transport_security_state_; | 121 TransportSecurityState* transport_security_state_; |
122 | 122 |
123 // Helper for safely writing the data. | 123 // Helper for safely writing the data. |
124 base::ImportantFileWriter writer_; | 124 scoped_ptr<base::ImportantFileWriterImpl> writer_; |
125 | 125 |
126 scoped_refptr<base::SequencedTaskRunner> foreground_runner_; | 126 scoped_refptr<base::SequencedTaskRunner> foreground_runner_; |
127 scoped_refptr<base::SequencedTaskRunner> background_runner_; | 127 scoped_refptr<base::SequencedTaskRunner> background_runner_; |
128 | 128 |
129 // Whether or not we're in read-only mode. | 129 // Whether or not we're in read-only mode. |
130 const bool readonly_; | 130 const bool readonly_; |
131 | 131 |
132 base::WeakPtrFactory<TransportSecurityPersister> weak_ptr_factory_; | 132 base::WeakPtrFactory<TransportSecurityPersister> weak_ptr_factory_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(TransportSecurityPersister); | 134 DISALLOW_COPY_AND_ASSIGN(TransportSecurityPersister); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace net | 137 } // namespace net |
138 | 138 |
139 #endif // NET_HTTP_TRANSPORT_SECURITY_PERSISTER_H_ | 139 #endif // NET_HTTP_TRANSPORT_SECURITY_PERSISTER_H_ |
OLD | NEW |