OLD | NEW |
1 // Copyright (c) 2009 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 // 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 |
11 // disk. For the moment, we don't want to delay startup for this load, so we | 11 // disk. For the moment, we don't want to delay startup for this load, so we |
(...skipping 15 matching lines...) Expand all Loading... |
27 // ... | 27 // ... |
28 // | 28 // |
29 // TransportSecurityPersister::SerialiseState | 29 // TransportSecurityPersister::SerialiseState |
30 // copies the current state of the TransportSecurityState, serialises | 30 // copies the current state of the TransportSecurityState, serialises |
31 // and writes to disk. | 31 // and writes to disk. |
32 | 32 |
33 #ifndef CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ | 33 #ifndef CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ |
34 #define CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ | 34 #define CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ |
35 #pragma once | 35 #pragma once |
36 | 36 |
| 37 #include <string> |
| 38 |
37 #include "base/file_path.h" | 39 #include "base/file_path.h" |
38 #include "base/lock.h" | |
39 #include "base/ref_counted.h" | 40 #include "base/ref_counted.h" |
40 #include "base/task.h" | 41 #include "base/task.h" |
41 #include "net/base/transport_security_state.h" | 42 #include "net/base/transport_security_state.h" |
42 | 43 |
43 class TransportSecurityPersister | 44 class TransportSecurityPersister |
44 : public base::RefCountedThreadSafe<TransportSecurityPersister>, | 45 : public base::RefCountedThreadSafe<TransportSecurityPersister>, |
45 public net::TransportSecurityState::Delegate { | 46 public net::TransportSecurityState::Delegate { |
46 public: | 47 public: |
47 TransportSecurityPersister(); | 48 TransportSecurityPersister(); |
48 void Initialize(net::TransportSecurityState* state, | 49 void Initialize(net::TransportSecurityState* state, |
(...skipping 17 matching lines...) Expand all Loading... |
66 ScopedRunnableMethodFactory<TransportSecurityPersister> save_coalescer_; | 67 ScopedRunnableMethodFactory<TransportSecurityPersister> save_coalescer_; |
67 | 68 |
68 scoped_refptr<net::TransportSecurityState> | 69 scoped_refptr<net::TransportSecurityState> |
69 transport_security_state_; // IO thread only. | 70 transport_security_state_; // IO thread only. |
70 | 71 |
71 // The path to the file in which we store the serialised state. | 72 // The path to the file in which we store the serialised state. |
72 FilePath state_file_; | 73 FilePath state_file_; |
73 }; | 74 }; |
74 | 75 |
75 #endif // CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ | 76 #endif // CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_ |
OLD | NEW |