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 #include "net/base/server_bound_cert_service.h" | 5 #include "net/base/server_bound_cert_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 WorkerDoneCallback callback_; | 288 WorkerDoneCallback callback_; |
289 | 289 |
290 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertServiceWorker); | 290 DISALLOW_COPY_AND_ASSIGN(ServerBoundCertServiceWorker); |
291 }; | 291 }; |
292 | 292 |
293 // A ServerBoundCertServiceJob is a one-to-one counterpart of an | 293 // A ServerBoundCertServiceJob is a one-to-one counterpart of an |
294 // ServerBoundCertServiceWorker. It lives only on the ServerBoundCertService's | 294 // ServerBoundCertServiceWorker. It lives only on the ServerBoundCertService's |
295 // origin message loop. | 295 // origin message loop. |
296 class ServerBoundCertServiceJob { | 296 class ServerBoundCertServiceJob { |
297 public: | 297 public: |
298 ServerBoundCertServiceJob(SSLClientCertType type) : type_(type) { | 298 explicit ServerBoundCertServiceJob(SSLClientCertType type) : type_(type) { |
299 } | 299 } |
300 | 300 |
301 ~ServerBoundCertServiceJob() { | 301 ~ServerBoundCertServiceJob() { |
302 if (!requests_.empty()) | 302 if (!requests_.empty()) |
303 DeleteAllCanceled(); | 303 DeleteAllCanceled(); |
304 } | 304 } |
305 | 305 |
306 SSLClientCertType type() const { return type_; } | 306 SSLClientCertType type() const { return type_; } |
307 | 307 |
308 void AddRequest(ServerBoundCertServiceRequest* request) { | 308 void AddRequest(ServerBoundCertServiceRequest* request) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 else | 538 else |
539 job->HandleResult(error, CLIENT_CERT_INVALID_TYPE, "", ""); | 539 job->HandleResult(error, CLIENT_CERT_INVALID_TYPE, "", ""); |
540 delete job; | 540 delete job; |
541 } | 541 } |
542 | 542 |
543 int ServerBoundCertService::cert_count() { | 543 int ServerBoundCertService::cert_count() { |
544 return server_bound_cert_store_->GetCertCount(); | 544 return server_bound_cert_store_->GetCertCount(); |
545 } | 545 } |
546 | 546 |
547 } // namespace net | 547 } // namespace net |
OLD | NEW |