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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 uint64 requests() const { return requests_; } | 121 uint64 requests() const { return requests_; } |
122 uint64 cert_store_hits() const { return cert_store_hits_; } | 122 uint64 cert_store_hits() const { return cert_store_hits_; } |
123 uint64 inflight_joins() const { return inflight_joins_; } | 123 uint64 inflight_joins() const { return inflight_joins_; } |
124 | 124 |
125 private: | 125 private: |
126 // Cancels the specified request. |req| is the handle stored by | 126 // Cancels the specified request. |req| is the handle stored by |
127 // GetDomainBoundCert(). After a request is canceled, its completion | 127 // GetDomainBoundCert(). After a request is canceled, its completion |
128 // callback will not be called. | 128 // callback will not be called. |
129 void CancelRequest(ServerBoundCertServiceRequest* req); | 129 void CancelRequest(ServerBoundCertServiceRequest* req); |
130 | 130 |
131 void HandleResult(const std::string& server_identifier, | 131 void GotServerBoundCert(const std::string& server_identifier, |
132 int error, | 132 SSLClientCertType type, |
133 scoped_ptr<ServerBoundCertStore::ServerBoundCert> cert); | 133 base::Time expiration_time, |
| 134 const std::string& key, |
| 135 const std::string& cert); |
| 136 void GeneratedServerBoundCert( |
| 137 const std::string& server_identifier, |
| 138 int error, |
| 139 scoped_ptr<ServerBoundCertStore::ServerBoundCert> cert); |
| 140 void HandleResult(int error, |
| 141 const std::string& server_identifier, |
| 142 SSLClientCertType type, |
| 143 const std::string& private_key, |
| 144 const std::string& cert); |
134 | 145 |
135 scoped_ptr<ServerBoundCertStore> server_bound_cert_store_; | 146 scoped_ptr<ServerBoundCertStore> server_bound_cert_store_; |
136 scoped_refptr<base::TaskRunner> task_runner_; | 147 scoped_refptr<base::TaskRunner> task_runner_; |
137 | 148 |
138 // inflight_ maps from a server to an active generation which is taking | 149 // inflight_ maps from a server to an active generation which is taking |
139 // place. | 150 // place. |
140 std::map<std::string, ServerBoundCertServiceJob*> inflight_; | 151 std::map<std::string, ServerBoundCertServiceJob*> inflight_; |
141 base::WeakPtrFactory<ServerBoundCertService> weak_ptr_factory_; | 152 base::WeakPtrFactory<ServerBoundCertService> weak_ptr_factory_; |
142 | 153 |
143 uint64 requests_; | 154 uint64 requests_; |
144 uint64 cert_store_hits_; | 155 uint64 cert_store_hits_; |
145 uint64 inflight_joins_; | 156 uint64 inflight_joins_; |
146 | 157 |
147 bool is_system_time_valid_; | 158 bool is_system_time_valid_; |
148 | 159 |
149 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertService); | 160 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertService); |
150 }; | 161 }; |
151 | 162 |
152 } // namespace net | 163 } // namespace net |
153 | 164 |
154 #endif // NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ | 165 #endif // NET_BASE_SERVER_BOUND_CERT_SERVICE_H_ |
OLD | NEW |