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 #ifndef NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ | 5 #ifndef NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ |
6 #define NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ | 6 #define NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Returns the backing ServerBoundCertStore. | 97 // Returns the backing ServerBoundCertStore. |
98 ServerBoundCertStore* GetCertStore(); | 98 ServerBoundCertStore* GetCertStore(); |
99 | 99 |
100 // Public only for unit testing. | 100 // Public only for unit testing. |
101 int cert_count(); | 101 int cert_count(); |
102 uint64 requests() const { return requests_; } | 102 uint64 requests() const { return requests_; } |
103 uint64 cert_store_hits() const { return cert_store_hits_; } | 103 uint64 cert_store_hits() const { return cert_store_hits_; } |
104 uint64 inflight_joins() const { return inflight_joins_; } | 104 uint64 inflight_joins() const { return inflight_joins_; } |
105 | 105 |
106 private: | 106 private: |
107 void HandleResult(const std::string& server_identifier, | 107 void GotServerBoundCert(const std::string& server_identifier, |
108 int error, | 108 SSLClientCertType type, |
109 scoped_ptr<ServerBoundCertStore::ServerBoundCert> cert); | 109 base::Time expiration_time, |
| 110 const std::string& key, |
| 111 const std::string& cert); |
| 112 void GeneratedServerBoundCert( |
| 113 const std::string& server_identifier, |
| 114 int error, |
| 115 scoped_ptr<ServerBoundCertStore::ServerBoundCert> cert); |
| 116 void HandleResult(int error, |
| 117 const std::string& server_identifier, |
| 118 SSLClientCertType type, |
| 119 const std::string& private_key, |
| 120 const std::string& cert); |
110 | 121 |
111 scoped_ptr<ServerBoundCertStore> server_bound_cert_store_; | 122 scoped_ptr<ServerBoundCertStore> server_bound_cert_store_; |
112 scoped_refptr<base::TaskRunner> task_runner_; | 123 scoped_refptr<base::TaskRunner> task_runner_; |
113 | 124 |
114 // inflight_ maps from a server to an active generation which is taking | 125 // inflight_ maps from a server to an active generation which is taking |
115 // place. | 126 // place. |
116 std::map<std::string, ServerBoundCertServiceJob*> inflight_; | 127 std::map<std::string, ServerBoundCertServiceJob*> inflight_; |
117 base::WeakPtrFactory<ServerBoundCertService> weak_ptr_factory_; | 128 base::WeakPtrFactory<ServerBoundCertService> weak_ptr_factory_; |
118 | 129 |
119 uint64 requests_; | 130 uint64 requests_; |
120 uint64 cert_store_hits_; | 131 uint64 cert_store_hits_; |
121 uint64 inflight_joins_; | 132 uint64 inflight_joins_; |
122 | 133 |
123 bool is_system_time_valid_; | 134 bool is_system_time_valid_; |
124 | 135 |
125 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertService); | 136 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertService); |
126 }; | 137 }; |
127 | 138 |
128 } // namespace net | 139 } // namespace net |
129 | 140 |
130 #endif // NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ | 141 #endif // NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ |
OLD | NEW |