| 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 20 matching lines...) Expand all Loading... |
| 31 // and writes to disk. | 31 // and writes to disk. |
| 32 | 32 |
| 33 #ifndef CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ | 33 #ifndef CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ |
| 34 #define CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ | 34 #define CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ |
| 35 | 35 |
| 36 #include <string> | 36 #include <string> |
| 37 | 37 |
| 38 #include "base/files/file_path.h" | 38 #include "base/files/file_path.h" |
| 39 #include "base/files/important_file_writer.h" | 39 #include "base/files/important_file_writer.h" |
| 40 #include "base/memory/weak_ptr.h" | 40 #include "base/memory/weak_ptr.h" |
| 41 #include "net/base/transport_security_state.h" | 41 #include "net/http/transport_security_state.h" |
| 42 | 42 |
| 43 // Reads and updates on-disk TransportSecurity state. | 43 // Reads and updates on-disk TransportSecurity state. |
| 44 // Must be created, used and destroyed only on the IO thread. | 44 // Must be created, used and destroyed only on the IO thread. |
| 45 class TransportSecurityPersister | 45 class TransportSecurityPersister |
| 46 : public net::TransportSecurityState::Delegate, | 46 : public net::TransportSecurityState::Delegate, |
| 47 public base::ImportantFileWriter::DataSerializer { | 47 public base::ImportantFileWriter::DataSerializer { |
| 48 public: | 48 public: |
| 49 TransportSecurityPersister(net::TransportSecurityState* state, | 49 TransportSecurityPersister(net::TransportSecurityState* state, |
| 50 const base::FilePath& profile_path, | 50 const base::FilePath& profile_path, |
| 51 bool readonly); | 51 bool readonly); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // Whether or not we're in read-only mode. | 122 // Whether or not we're in read-only mode. |
| 123 const bool readonly_; | 123 const bool readonly_; |
| 124 | 124 |
| 125 base::WeakPtrFactory<TransportSecurityPersister> weak_ptr_factory_; | 125 base::WeakPtrFactory<TransportSecurityPersister> weak_ptr_factory_; |
| 126 | 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(TransportSecurityPersister); | 127 DISALLOW_COPY_AND_ASSIGN(TransportSecurityPersister); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 #endif // CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ | 130 #endif // CHROME_BROWSER_NET_TRANSPORT_SECURITY_PERSISTER_H_ |
| OLD | NEW |